Use Sources.bp for building

Reference Sources.bp from Android.bp, so that they are used as build
files.

Sources.bp is separate from Android.bp as it was migrated from the
Android.bp files in the old code location. They can be merged into the
main Android.bp file (or removed by removing the filegroups) after the
migration is done.

Also remove references to the AIDL filegroups, as files are now merged
into the common framework/aidl-export directory which is used as include
directory for aidl source generation already, so they do not need to be
referenced separately. framework/aidl-export can contain AIDLs for S-
API classes that became updatable API in T (the contents of
framework-t), as they are the same as any other API class for the
purposes of AIDL code generation: it's OK for any S+ code to reference
S+ API classes.

Finally, fix reference to mByteStream in IpConfigStoreTest. It was
already wrong but did not break the build because the test was not being
built in the old location.

Bug: 222234190
Test: TH
Merged-In: I87843d554d1e726158f8784aa2ec61c92867ad3e
Change-Id: I9093f9ae2f9d76e597f20de48680e459891755b4
diff --git a/framework-t/Android.bp b/framework-t/Android.bp
index f46d887..1e508a0 100644
--- a/framework-t/Android.bp
+++ b/framework-t/Android.bp
@@ -19,6 +19,9 @@
     default_applicable_licenses: ["Android-Apache-2.0"],
 }
 
+// Include build rules from Sources.bp
+build = ["Sources.bp"]
+
 java_defaults {
     name: "enable-framework-connectivity-t-targets",
     enabled: true,
diff --git a/framework-t/Sources.bp b/framework-t/Sources.bp
index bc27852..53b4163 100644
--- a/framework-t/Sources.bp
+++ b/framework-t/Sources.bp
@@ -14,11 +14,6 @@
 // limitations under the License.
 //
 
-package {
-    // See: http://go/android-license-faq
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
 // NetworkStats related libraries.
 
 filegroup {
@@ -47,22 +42,9 @@
 }
 
 filegroup {
-    name: "framework-connectivity-netstats-aidl-export-sources",
-    srcs: [
-        "aidl-export/android/net/NetworkStats.aidl",
-        "aidl-export/android/net/NetworkTemplate.aidl",
-    ],
-    path: "aidl-export",
-    visibility: [
-        "//visibility:private",
-    ],
-}
-
-filegroup {
     name: "framework-connectivity-netstats-sources",
     srcs: [
         ":framework-connectivity-netstats-internal-sources",
-        ":framework-connectivity-netstats-aidl-export-sources",
     ],
     visibility: [
         "//visibility:private",
@@ -84,21 +66,9 @@
 }
 
 filegroup {
-    name: "framework-connectivity-nsd-aidl-export-sources",
-    srcs: [
-        "aidl-export/android/net/nsd/*.aidl",
-    ],
-    path: "aidl-export",
-    visibility: [
-        "//visibility:private",
-    ],
-}
-
-filegroup {
     name: "framework-connectivity-nsd-sources",
     srcs: [
         ":framework-connectivity-nsd-internal-sources",
-        ":framework-connectivity-nsd-aidl-export-sources",
     ],
     visibility: [
         "//visibility:private",
diff --git a/service-t/Android.bp b/service-t/Android.bp
index 8851554..50dd995 100644
--- a/service-t/Android.bp
+++ b/service-t/Android.bp
@@ -19,6 +19,9 @@
     default_applicable_licenses: ["Android-Apache-2.0"],
 }
 
+// Include build rules from Sources.bp
+build = ["Sources.bp"]
+
 // This builds T+ services depending on framework-connectivity-t
 // hidden symbols separately from the S+ services, to ensure that S+
 // services cannot accidentally depend on T+ hidden symbols from
diff --git a/service-t/Sources.bp b/service-t/Sources.bp
index 4b799c5..04866fb 100644
--- a/service-t/Sources.bp
+++ b/service-t/Sources.bp
@@ -14,11 +14,6 @@
 // limitations under the License.
 //
 
-package {
-    // See: http://go/android-license-faq
-    default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
 // NetworkStats related libraries.
 
 filegroup {
diff --git a/tests/unit/java/com/android/server/net/IpConfigStoreTest.java b/tests/unit/java/com/android/server/net/IpConfigStoreTest.java
index ad0be58..e9a5309 100644
--- a/tests/unit/java/com/android/server/net/IpConfigStoreTest.java
+++ b/tests/unit/java/com/android/server/net/IpConfigStoreTest.java
@@ -105,7 +105,7 @@
         IpConfigStore store = new IpConfigStore(writer);
         store.writeIpConfigurations("file/path/not/used/", expectedNetworks);
 
-        InputStream in = new ByteArrayInputStream(writer.byteStream.toByteArray());
+        InputStream in = new ByteArrayInputStream(writer.mByteStream.toByteArray());
         ArrayMap<String, IpConfiguration> actualNetworks = IpConfigStore.readIpConfigurations(in);
         assertNotNull(actualNetworks);
         assertEquals(2, actualNetworks.size());