Do not start VrManagerService if VR is not supported
When VR mode is not supported by removing the feature of android.hardware.vr.high_performance, do not start VrManagerService. Otherwise, there will be undesired behavior, such as calling into PowerHal/VrHal for VR hints. Test: no undesired behavior observed Bug: 116427118 Change-Id: I3e3c1f02c2fad958d8659d7957d005d25d823c3e Merged-In: I3e3c1f02c2fad958d8659d7957d005d25d823c3e
This commit is contained in:
@@ -767,6 +767,9 @@ public final class SystemServer {
|
||||
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();
|
||||
@@ -900,7 +903,7 @@ public final class SystemServer {
|
||||
traceLog.traceEnd();
|
||||
}, START_HIDL_SERVICES);
|
||||
|
||||
if (!isWatch) {
|
||||
if (!isWatch && enableVrService) {
|
||||
traceBeginAndSlog("StartVrManagerService");
|
||||
mSystemServiceManager.startService(VrManagerService.class);
|
||||
traceEnd();
|
||||
|
||||
Reference in New Issue
Block a user