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

Commit fb13364f authored by Chun-Ku Lin's avatar Chun-Ku Lin
Browse files

Fix MenuViewLayerTest on AAOS

**Root cause**
On AAOS system user and real user is different. We need to differenciate
that in the test.

Bug: 345134377
Bug: 348124412
Test: atest MenuViewLayerTest
Flag: TEST_ONLY

Change-Id: I8348880b59f542e8e29d174e95c721ad10c09c8b
parent 0ae69b63
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -258,8 +258,9 @@ public class MenuViewLayerTest extends SysuiTestCase {
        setupEnabledAccessibilityServiceList();

        mMenuViewLayer.mDismissMenuAction.run();
        final String value = Settings.Secure.getString(mSpyContext.getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
        final String value = Settings.Secure.getStringForUser(mSpyContext.getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                mSecureSettings.getRealUserHandle(UserHandle.USER_CURRENT));

        assertThat(value).isEqualTo("");
    }
@@ -274,8 +275,9 @@ public class MenuViewLayerTest extends SysuiTestCase {
                ShortcutConstants.UserShortcutType.HARDWARE)).thenReturn(stubShortcutTargets);

        mMenuViewLayer.mDismissMenuAction.run();
        final String value = Settings.Secure.getString(mSpyContext.getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
        final String value = Settings.Secure.getStringForUser(mSpyContext.getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                mSecureSettings.getRealUserHandle(UserHandle.USER_CURRENT));

        assertThat(value).isEqualTo(TEST_SELECT_TO_SPEAK_COMPONENT_NAME.flattenToString());
    }
@@ -445,9 +447,11 @@ public class MenuViewLayerTest extends SysuiTestCase {
    }

    private void setupEnabledAccessibilityServiceList() {
        Settings.Secure.putString(mSpyContext.getContentResolver(),
        Settings.Secure.putStringForUser(mSpyContext.getContentResolver(),
                Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES,
                TEST_SELECT_TO_SPEAK_COMPONENT_NAME.flattenToString());
                TEST_SELECT_TO_SPEAK_COMPONENT_NAME.flattenToString(),
                mSecureSettings.getRealUserHandle(UserHandle.USER_CURRENT)
        );

        final ResolveInfo resolveInfo = new ResolveInfo();
        final ServiceInfo serviceInfo = new ServiceInfo();