Add min_sdk_version to connectivity targets

All targets need min_sdk_version 30 to be included in the tethering
APEX. They will actually never be used on SDK 30 and are only loaded on
31, but this is necessary to be included in com.android.tethering.

Bug: 171540887
Test: m
Change-Id: I190fd1f3c9fabff057d0a2bd7f45b63a4fe447b3
diff --git a/framework/Android.bp b/framework/Android.bp
index de71af4..80c68f2 100644
--- a/framework/Android.bp
+++ b/framework/Android.bp
@@ -26,6 +26,7 @@
 java_library {
     name: "framework-connectivity-protos",
     sdk_version: "module_current",
+    min_sdk_version: "30",
     proto: {
         type: "nano",
     },
@@ -109,6 +110,10 @@
         "-Wall",
         "-Werror",
         "-Wno-unused-parameter",
+        // Don't warn about S API usage even with
+        // min_sdk 30: the library is only loaded
+        // on S+ devices
+        "-Wno-unguarded-availability",
         "-Wthread-safety",
     ],
     shared_libs: [
@@ -135,6 +140,7 @@
 
 cc_library_shared {
     name: "libframework-connectivity-jni",
+    min_sdk_version: "30",
     defaults: ["libframework-connectivity-defaults"],
     srcs: [
         "jni/android_net_NetworkUtils.cpp",
@@ -151,6 +157,7 @@
 java_library {
     name: "framework-connectivity.impl",
     sdk_version: "module_current",
+    min_sdk_version: "30",
     srcs: [
         ":framework-connectivity-sources",
     ],