Revert "Revert "Do not start VrManagerService if VR is not supported""
This reverts commit f5d99fa7d93f82701c188c4048f0c2a5af122fae.
Bug: 112064298
Change-Id: Ib2b595f8f98a577af205d5169af28a185ef00f03
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 0b6a33f..c426ef3 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -794,6 +794,9 @@
boolean isWatch = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WATCH);
+ boolean enableVrService = context.getPackageManager().hasSystemFeature(
+ PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE);
+
// For debugging RescueParty
if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean("debug.crash_system", false)) {
throw new RuntimeException();
@@ -927,7 +930,7 @@
traceLog.traceEnd();
}, START_HIDL_SERVICES);
- if (!isWatch) {
+ if (!isWatch && enableVrService) {
traceBeginAndSlog("StartVrManagerService");
mSystemServiceManager.startService(VrManagerService.class);
traceEnd();