Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 728ebf1a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make VrManager service optional." into cw-f-dev

parents f1476d91 ef89d21a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2313,6 +2313,9 @@ public final class ActivityManagerService extends ActivityManagerNative
            } break;
            case VR_MODE_CHANGE_MSG: {
                VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class);
                if (vrService == null) {
                    break;
                }
                final ActivityRecord r = (ActivityRecord) msg.obj;
                boolean vrMode;
                ComponentName requestedPackage;
+6 −4
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ public class LightsService extends SystemService {
        if (phase == PHASE_SYSTEM_SERVICES_READY) {
            IVrManager vrManager =
                    (IVrManager) getBinderService(VrManagerService.VR_MANAGER_BINDER_SERVICE);
            if (vrManager != null) {
                try {
                    vrManager.registerListener(mVrStateCallbacks);
                } catch (RemoteException e) {
@@ -179,6 +180,7 @@ public class LightsService extends SystemService {
                }
            }
        }
    }

    private int getVrDisplayMode() {
        int currentUser = ActivityManager.getCurrentUser();
+0 −3
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ import com.android.server.lights.LightsManager;
import com.android.server.notification.ManagedServices.ManagedServiceInfo;
import com.android.server.policy.PhoneWindowManager;
import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.vr.VrManagerInternal;
import com.android.server.notification.ManagedServices.UserProfiles;

import libcore.io.IoUtils;
@@ -232,7 +231,6 @@ public class NotificationManagerService extends SystemService {
    AudioManagerInternal mAudioManagerInternal;
    @Nullable StatusBarManagerInternal mStatusBar;
    Vibrator mVibrator;
    private VrManagerInternal mVrManagerInternal;
    private WindowManagerInternal mWindowManagerInternal;

    final IBinder mForegroundToken = new Binder();
@@ -1128,7 +1126,6 @@ public class NotificationManagerService extends SystemService {
            // Grab our optional AudioService
            mAudioManager = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
            mAudioManagerInternal = getLocalService(AudioManagerInternal.class);
            mVrManagerInternal = getLocalService(VrManagerInternal.class);
            mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
            mZenModeHelper.onSystemReady();
        } else if (phase == SystemService.PHASE_THIRD_PARTY_APPS_CAN_START) {
+6 −4
Original line number Diff line number Diff line
@@ -669,11 +669,13 @@ public final class PowerManagerService extends SystemService
                    false, mSettingsObserver, UserHandle.USER_ALL);
            IVrManager vrManager =
                    (IVrManager) getBinderService(VrManagerService.VR_MANAGER_BINDER_SERVICE);
            if (vrManager != null) {
                try {
                    vrManager.registerListener(mVrStateCallbacks);
                } catch (RemoteException e) {
                    Slog.e(TAG, "Failed to register VR mode state listener: " + e);
                }
            }
            // Go.
            readConfigurationLocked();
            updateSettingsLocked();
+6 −3
Original line number Diff line number Diff line
@@ -553,6 +553,7 @@ public final class SystemServer {
                false);

        boolean disableConsumerIr = SystemProperties.getBoolean("config.disable_consumerir", false);
        boolean disableVrManager = SystemProperties.getBoolean("config.disable_vrmanager", false);

        boolean isEmulator = SystemProperties.get("ro.kernel.qemu").equals("1");

@@ -626,9 +627,11 @@ public final class SystemServer {
            ServiceManager.addService(Context.INPUT_SERVICE, inputManager);
            Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);

            if (!disableVrManager) {
                traceBeginAndSlog("StartVrManagerService");
                mSystemServiceManager.startService(VrManagerService.class);
                Trace.traceEnd(Trace.TRACE_TAG_SYSTEM_SERVER);
            }

            mActivityManagerService.setWindowManager(wm);