From 0395b7000008bfd1c194333bb45cbadc0ef0ad29 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Tue, 8 Mar 2022 19:49:49 +0900 Subject: [PATCH] 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: I81893df9f327abb84f1561b2b33027a2d23a4d65 Merged-In: I67c703e3f7aa9d5787f032a79ed62e45412baf4f Change-Id: I9093f9ae2f9d76e597f20de48680e459891755b4 --- framework-t/Android.bp | 3 ++ framework-t/Sources.bp | 30 ------------------- service-t/Android.bp | 3 ++ service-t/Sources.bp | 5 ---- .../android/server/net/IpConfigStoreTest.java | 2 +- 5 files changed, 7 insertions(+), 36 deletions(-) diff --git a/framework-t/Android.bp b/framework-t/Android.bp index f46d887f78..1e508a04bd 100644 --- a/framework-t/Android.bp +++ b/framework-t/Android.bp @@ -19,6 +19,9 @@ package { 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 bc27852857..53b4163b93 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 { @@ -46,23 +41,10 @@ filegroup { ], } -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", @@ -83,22 +65,10 @@ filegroup { ], } -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 8851554751..50dd995ef4 100644 --- a/service-t/Android.bp +++ b/service-t/Android.bp @@ -19,6 +19,9 @@ package { 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 4b799c599b..04866fb9cc 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 ad0be5862c..e9a53096b7 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 @@ public class IpConfigStoreTest { 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 actualNetworks = IpConfigStore.readIpConfigurations(in); assertNotNull(actualNetworks); assertEquals(2, actualNetworks.size());