From b896c588af5489999c3a22e3713a2491811456c2 Mon Sep 17 00:00:00 2001 From: Brad Stenning Date: Wed, 11 Sep 2019 11:40:45 -0700 Subject: [PATCH] Fix build file such that CarSystemUi can be easily extended This is done buy building all of CarSystemUI as a library and then including that library as a static lib for an android_app target. Thus anyone that wants to build a derivative to CarSystemUI can include that library and start extending. It is the same mechanism that allows CarSystemUI to extend the phone SystemUI Bug:140875212 Test: Build and Deploy Change-Id: I4c83b0147c5ce8a8b4321ba0866721e4922df431 --- packages/CarSystemUI/Android.bp | 43 ++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/packages/CarSystemUI/Android.bp b/packages/CarSystemUI/Android.bp index bbae9ff516154..672879ae6e9d4 100644 --- a/packages/CarSystemUI/Android.bp +++ b/packages/CarSystemUI/Android.bp @@ -13,18 +13,19 @@ // See the License for the specific language governing permissions and // limitations under the License. // -android_app { - name: "CarSystemUI", - - overrides: [ - "SystemUI", - ], +android_library { + name: "CarSystemUI-core", srcs: [ "src/**/*.java", "src/**/I*.aidl", ], + resource_dirs: [ + "res-keyguard", + "res", + ], + static_libs: [ "SystemUI-core", "CarNotificationLib", @@ -58,6 +59,28 @@ android_app { manifest: "AndroidManifest.xml", + plugins: ["dagger2-compiler-2.19"], + +} + +android_app { + name: "CarSystemUI", + + static_libs: [ + "CarSystemUI-core", + ], + + libs: [ + "telephony-common", + "android.car", + ], + + resource_dirs: [], + + overrides: [ + "SystemUI", + ], + platform_apis: true, product_specific: true, certificate: "platform", @@ -68,12 +91,6 @@ android_app { "proguard.flags", ], }, - resource_dirs: [ - "res-keyguard", - "res", - ], - - dxflags: ["--multi-dex"], aaptflags: [ @@ -81,6 +98,8 @@ android_app { "com.android.keyguard", ], + kotlincflags: ["-Xjvm-default=enable"], + plugins: ["dagger2-compiler-2.19"], required: ["privapp_whitelist_com.android.systemui"],