diff --git a/staticlibs/Android.bp b/staticlibs/Android.bp index 5c851fd2f7..713a0d61d7 100644 --- a/staticlibs/Android.bp +++ b/staticlibs/Android.bp @@ -17,6 +17,11 @@ // library directly. // 2. The "net-utils-services-common" library is for use by modules and frameworks/base/services. // It does not need to be jarjared because it is not placed on the bootclasspath. +// 3. The "net-utils-telephony-common-srcs" filegroup is for use specifically by telephony, which +// places many of its classes, even non-API service classes, on the boot classpath. Any file that +// is added to this filegroup *must* have a corresponding jarjar rule in the telephony jarjar +// rules file. Otherwise, it will end up on the boot classpath and other modules will not be able +// to provide their own copy. filegroup { name: "net-utils-framework-common-srcs", @@ -26,7 +31,7 @@ filegroup { java_library { name: "net-utils-framework-common", - srcs: [":net-utils-framework-common-srcs" ], + srcs: [":net-utils-framework-common-srcs"], jarjar_rules: "jarjar-rules-shared.txt", visibility: [ "//frameworks/base/packages/Tethering", @@ -50,3 +55,16 @@ java_library { "//packages/modules/CaptivePortalLogin", ], } + +// Use a filegroup and not a library for telephony sources, as framework-annotations cannot be +// included either (some annotations would be duplicated on the bootclasspath). +filegroup { + name: "net-utils-telephony-common-srcs", + srcs: [ + // Any class here *must* have a corresponding jarjar rule in the telephony build rules. + "src_servicescommon/android/net/NetworkFactory.java", + ], + visibility: [ + "//frameworks/opt/telephony", + ], +}