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

Commit 41a4cdbd authored by Shivangi Dubey's avatar Shivangi Dubey
Browse files

Fix SecurityException on accepting auto-rotate suggestion

Fixes: 414546956
Flag: com.android.window.flags.enable_device_state_auto_rotate_setting_refactor
Test: Make build -> enable above mentioned flag -> accept auto-rotate suggestion -> new rotation should be applied
Change-Id: I73072f6dff90d54abb2331a4f2d1cb3fcabce130
parent 38ae6341
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -4717,10 +4717,15 @@ public class WindowManagerService extends IWindowManager.Stub
                    "API setRotationAtAngleIfLocked should not be used when "
                            + "enableDeviceStateAutoRotateSettingRefactor is disabled");
        }
        final long origId = Binder.clearCallingIdentity();
        try {
            synchronized (mGlobalLock) {
                final DisplayContent display = mRoot.getDefaultDisplay();
                display.getDisplayRotation().setRotationAtAngleIfLocked(rotation, caller);
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
        }
    }

    @Override