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/AndroidManifest.xml b/service/AndroidManifest.xml
index 82a4896..01cdc03 100644
--- a/service/AndroidManifest.xml
+++ b/service/AndroidManifest.xml
@@ -503,6 +503,15 @@
android:label="@string/car_permission_label_car_test_service"
android:description="@string/car_permission_desc_car_test_service" />
+ <!-- Allows system app to enable / disable / query features in the system.
+ <p>Protection level: signature|privileged
+ -->
+ <permission
+ android:name="android.car.permission.CONTROL_CAR_FEATURES"
+ android:protectionLevel="signature|privileged"
+ android:label="@string/car_permission_label_control_car_features"
+ android:description="@string/car_permission_desc_control_car_features" />
+
<!-- Allows an application to read vendor properties related with windows.
<p>Protection level: signature|privileged
-->