Loading core/java/android/app/ApplicationPackageManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.Immutable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.SomeArgs; import com.android.internal.pm.RoSystemFeatures; import com.android.internal.util.UserIcons; import dalvik.system.VMRuntime; Loading Loading @@ -818,6 +819,16 @@ public class ApplicationPackageManager extends PackageManager { @Override public Boolean recompute(HasSystemFeatureQuery query) { try { // As an optimization, check first to see if the feature was defined at // compile-time as either available or unavailable. // TODO(b/203143243): Consider hoisting this optimization out of the cache // after the trunk stable (build) flag has soaked and more features are // defined at compile-time. Boolean maybeHasSystemFeature = RoSystemFeatures.maybeHasFeature(query.name, query.version); if (maybeHasSystemFeature != null) { return maybeHasSystemFeature.booleanValue(); } return ActivityThread.currentActivityThread().getPackageManager(). hasSystemFeature(query.name, query.version); } catch (RemoteException e) { Loading services/java/com/android/server/SystemServer.java +4 −6 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.notification.SystemNotificationChannels; import com.android.internal.os.BinderInternal; import com.android.internal.os.RuntimeInit; import com.android.internal.pm.RoSystemFeatures; import com.android.internal.policy.AttributeCache; import com.android.internal.util.ConcurrentUtils; import com.android.internal.util.EmergencyAffordanceManager; Loading Loading @@ -1465,8 +1466,7 @@ public final class SystemServer implements Dumpable { boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", false); boolean isWatch = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WATCH); boolean isWatch = RoSystemFeatures.hasFeatureWatch(context); boolean isArc = context.getPackageManager().hasSystemFeature( "org.chromium.arc"); Loading Loading @@ -2708,7 +2708,7 @@ public final class SystemServer implements Dumpable { t.traceEnd(); } if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED)) { if (RoSystemFeatures.hasFeatureEmbedded(context)) { t.traceBegin("StartIoTSystemService"); mSystemServiceManager.startService(IOT_SERVICE_CLASS); t.traceEnd(); Loading Loading @@ -3077,9 +3077,7 @@ public final class SystemServer implements Dumpable { }, WEBVIEW_PREPARATION); } boolean isAutomotive = mPackageManager .hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE); if (isAutomotive) { if (RoSystemFeatures.hasFeatureAutomotive(context)) { t.traceBegin("StartCarServiceHelperService"); final SystemService cshs = mSystemServiceManager .startService(CAR_SERVICE_HELPER_SERVICE_CLASS); Loading Loading
core/java/android/app/ApplicationPackageManager.java +11 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.Immutable; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.os.SomeArgs; import com.android.internal.pm.RoSystemFeatures; import com.android.internal.util.UserIcons; import dalvik.system.VMRuntime; Loading Loading @@ -818,6 +819,16 @@ public class ApplicationPackageManager extends PackageManager { @Override public Boolean recompute(HasSystemFeatureQuery query) { try { // As an optimization, check first to see if the feature was defined at // compile-time as either available or unavailable. // TODO(b/203143243): Consider hoisting this optimization out of the cache // after the trunk stable (build) flag has soaked and more features are // defined at compile-time. Boolean maybeHasSystemFeature = RoSystemFeatures.maybeHasFeature(query.name, query.version); if (maybeHasSystemFeature != null) { return maybeHasSystemFeature.booleanValue(); } return ActivityThread.currentActivityThread().getPackageManager(). hasSystemFeature(query.name, query.version); } catch (RemoteException e) { Loading
services/java/com/android/server/SystemServer.java +4 −6 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.notification.SystemNotificationChannels; import com.android.internal.os.BinderInternal; import com.android.internal.os.RuntimeInit; import com.android.internal.pm.RoSystemFeatures; import com.android.internal.policy.AttributeCache; import com.android.internal.util.ConcurrentUtils; import com.android.internal.util.EmergencyAffordanceManager; Loading Loading @@ -1465,8 +1466,7 @@ public final class SystemServer implements Dumpable { boolean disableCameraService = SystemProperties.getBoolean("config.disable_cameraservice", false); boolean isWatch = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_WATCH); boolean isWatch = RoSystemFeatures.hasFeatureWatch(context); boolean isArc = context.getPackageManager().hasSystemFeature( "org.chromium.arc"); Loading Loading @@ -2708,7 +2708,7 @@ public final class SystemServer implements Dumpable { t.traceEnd(); } if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED)) { if (RoSystemFeatures.hasFeatureEmbedded(context)) { t.traceBegin("StartIoTSystemService"); mSystemServiceManager.startService(IOT_SERVICE_CLASS); t.traceEnd(); Loading Loading @@ -3077,9 +3077,7 @@ public final class SystemServer implements Dumpable { }, WEBVIEW_PREPARATION); } boolean isAutomotive = mPackageManager .hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE); if (isAutomotive) { if (RoSystemFeatures.hasFeatureAutomotive(context)) { t.traceBegin("StartCarServiceHelperService"); final SystemService cshs = mSystemServiceManager .startService(CAR_SERVICE_HELPER_SERVICE_CLASS); Loading