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

Commit de58aa1d authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Move observer registration to bg thread

Test: manual, rotation tile
Test: atest RotationLockControllerImpl
Bug: 407698587
Flag: EXEMPT bugfix
Change-Id: I1f814fc5f9f968e54be87cda3e649252a57f5c52
parent 4d9fc173
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -107,5 +107,6 @@ public class RotationLockControllerImplTest extends SysuiTestCase {
                mFakeExecutor,
                mFakeExecutor
        );
        mFakeExecutor.runAllReady();
    }
}
+5 −3
Original line number Diff line number Diff line
@@ -123,10 +123,12 @@ public final class RotationLockControllerImpl implements RotationLockController
    @Override
    public void setListening(boolean listening) {
        if (listening) {
            mRotationPolicy.registerRotationPolicyListener(mRotationPolicyListener,
                    UserHandle.USER_ALL);
            mBgExecutor.execute(
                    () -> mRotationPolicy.registerRotationPolicyListener(mRotationPolicyListener,
                            UserHandle.USER_ALL));
        } else {
            mRotationPolicy.unregisterRotationPolicyListener(mRotationPolicyListener);
            mBgExecutor.execute(() -> mRotationPolicy.unregisterRotationPolicyListener(
                    mRotationPolicyListener));
        }
        if (mIsPerDeviceStateRotationLockEnabled
                && mDeviceStateRotationLockSettingController.isPresent()) {