add feature support
- Add optional and experimental feature infra.
- Feature is defined as a string name. All Car.*SERVICE used for Car*Manager
are features. Additional non-API features are defined in CarFeatures but
each API can define its own feature under its own name space.
- There can be subfeature with the format of "main_feature_name/sub_feature_name".
- Feature can be enabed / disabled using Car.[enable|disable]Feature() call but it will only take effect upon reboot.
- Added shell command to test enabling / disabling feature.
- Added experimental feature infra under separate package and static API.
Experimental feature is for development purpose and will not be included in
user build.
- Removed old feature related code which are not used anywhere.
- Kitchen sink test requires enabling the feature to work:
$adb root; adb shell dumpsys car_service enable-feature android.car.experimental.test_demo_experimental_feature_service; adb reboot
Bug: 144504820
Test: shell command, run added apitest: android.car.apitest.CarFeatureTest, run ExperimentalFeature in kitchensink
- Test through command line
$ adb root; adb shell cmd car_service disable-feature com.android.car.user.CarUserNoticeService; adb reboot
// user notice service should not show up
$ adb root; adb shell cmd car_service enable-feature com.android.car.user.CarUserNoticeService; adb reboot
// user notice service should show up
- Test experimental feature with kitchensink
$ adb root; adb shell cmd car_service enable-feature android.car.experimental.test_demo_experimental_feature_service; adb reboot
// Launch kitchensink experimental feature page and check the button works.
$ adb root; adb shell cmd car_service disable-feature android.car.experimental.test_demo_experimental_feature_service; adb reboot
// Launch kitchensink experimental feature page and check the button not working.
Change-Id: I75239193f7efab3a156dfe9f64370f4a5fd673a4
diff --git a/service/Android.bp b/service/Android.bp
index f832902..0035441 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -68,6 +68,23 @@
},
}
+java_library {
+
+ name: "car-service-common-util-static-lib",
+
+ srcs: [
+ "src/com/android/car/CarServiceBase.java",
+ "src/com/android/car/CarServiceUtils.java",
+ "src/com/android/car/CarLog.java",
+ ],
+
+ product_variables: {
+ pdk: {
+ enabled: false,
+ },
+ },
+}
+
//####################################################################################
// Build a static library to help mocking various car services in testing. This is meant to be used
// for internal unit tests around the car service.