[AAPM] Disable for unsupported form factors.
The initial launch is targeted towards general purpose devices.
Other form factors may be added later.
Bug: 352420507
Flag: android.security.aapm_api
Test: Presubmits
Change-Id: I15e5ac313e15f50032437515dd8d704559212c8e
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index e052f94..2461c1c 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -1504,6 +1504,8 @@
boolean isTv = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_LEANBACK);
+ boolean isAutomotive = RoSystemFeatures.hasFeatureAutomotive(context);
+
boolean enableVrService = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE);
@@ -1760,7 +1762,8 @@
t.traceEnd();
}
- if (android.security.Flags.aapmApi()) {
+ if (!isWatch && !isTv && !isAutomotive
+ && android.security.Flags.aapmApi()) {
t.traceBegin("StartAdvancedProtectionService");
mSystemServiceManager.startService(AdvancedProtectionService.Lifecycle.class);
t.traceEnd();
@@ -3137,7 +3140,7 @@
}, WEBVIEW_PREPARATION);
}
- if (RoSystemFeatures.hasFeatureAutomotive(context)) {
+ if (isAutomotive) {
t.traceBegin("StartCarServiceHelperService");
final SystemService cshs = mSystemServiceManager
.startService(CAR_SERVICE_HELPER_SERVICE_CLASS);