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

Commit 81027c9a authored by Daniel Norman's avatar Daniel Norman Committed by Android (Google) Code Review
Browse files

Merge "fix(magnify_ime): Magnify IME setting with multiple user switching" into main

parents 2082302a f66c4938
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3917,6 +3917,10 @@ public class WindowManagerService extends IWindowManager.Stub
                    }
                }
            }

            // This call is crucial on user switch to ensure the Magnify IME state
            // is correctly re-evaluated and applied for the new user.
            mSettingsObserver.updateMagnifyIme();
            mAtmService.mChainTracker.end();
        }
    }
+26 −0
Original line number Diff line number Diff line
@@ -924,6 +924,32 @@ public class WindowStateTests extends WindowTestsBase {
        assertTrue(window.isVisibleByPolicy());
    }

    @Test
    @EnableFlags(com.android.server.accessibility
            .Flags.FLAG_ENABLE_MAGNIFICATION_MAGNIFY_NAV_BAR_AND_IME)
    public void testSwitchUser_settingValueIsDisabled_shouldNotMagnify() {
        final ContentResolver cr = useFakeSettingsProvider();
        Settings.Secure.putIntForUser(cr,
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MAGNIFY_NAV_AND_IME, 0, 1);

        mWm.setCurrentUser(1);

        assertFalse(mWm.isMagnifyImeEnabled());
    }

    @Test
    @EnableFlags(com.android.server.accessibility
            .Flags.FLAG_ENABLE_MAGNIFICATION_MAGNIFY_NAV_BAR_AND_IME)
    public void testSwitchUser_settingValueIsEnabled_shouldMagnify() {
        final ContentResolver cr = useFakeSettingsProvider();
        Settings.Secure.putIntForUser(cr,
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MAGNIFY_NAV_AND_IME, 1, 2);

        mWm.setCurrentUser(2);

        assertTrue(mWm.isMagnifyImeEnabled());
    }

    @Test
    public void testCompatOverrideScale() {
        final float overrideScale = 2; // 0.5x on client side.