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

Commit d218036f authored by Min Xia's avatar Min Xia Committed by Android (Google) Code Review
Browse files

Merge "Add clearCallingIdentity for VrManagerService.setVr2dDisplayProperties." into pi-dev

parents 15499143 2936ad33
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -1327,10 +1327,15 @@ public class VrManagerService extends SystemService

    public void setVr2dDisplayProperties(
        Vr2dDisplayProperties compatDisplayProp) {
        final long token = Binder.clearCallingIdentity();
        try {
            if (mVr2dDisplay != null) {
                mVr2dDisplay.setVirtualDisplayProperties(compatDisplayProp);
                return;
            }
        } finally {
            Binder.restoreCallingIdentity(token);
        }
        Slog.w(TAG, "Vr2dDisplay is null!");
    }

@@ -1345,11 +1350,14 @@ public class VrManagerService extends SystemService
    private void setAndBindCompositor(ComponentName componentName) {
        final int userId = UserHandle.getCallingUserId();
        final long token = Binder.clearCallingIdentity();
        try {
            synchronized (mLock) {
                updateCompositorServiceLocked(userId, componentName);
            }
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }

    private void updateCompositorServiceLocked(int userId, ComponentName componentName) {
        if (mCurrentVrCompositorService != null