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

Commit 92d21839 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove FLAG_SHOW_FOR_ALL_USERS to avoid crash in a11y"

parents 601847e5 0f64b3cf
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -262,8 +262,6 @@ public class AccessibilityShortcutController {
        String toastMessage = String.format(toastMessageFormatString, serviceName);
        String toastMessage = String.format(toastMessageFormatString, serviceName);
        Toast warningToast = mFrameworkObjectProvider.makeToastFromText(
        Toast warningToast = mFrameworkObjectProvider.makeToastFromText(
                mContext, toastMessage, Toast.LENGTH_LONG);
                mContext, toastMessage, Toast.LENGTH_LONG);
        warningToast.getWindowParams().privateFlags |=
                WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
        warningToast.show();
        warningToast.show();
    }
    }


+4 −3
Original line number Original line Diff line number Diff line
@@ -362,9 +362,10 @@ public class AccessibilityShortcutControllerTest {
        accessibilityShortcutController.performAccessibilityShortcut();
        accessibilityShortcutController.performAccessibilityShortcut();
        accessibilityShortcutController.performAccessibilityShortcut();
        accessibilityShortcutController.performAccessibilityShortcut();
        verify(mToast).show();
        verify(mToast).show();
        assertEquals(WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS,
        // TODO(b/149408635): Reintroduce assertion
                mLayoutParams.privateFlags
        // assertEquals(WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS,
                        & WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS);
        //        mLayoutParams.privateFlags
        //                & WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS);
        verify(mAccessibilityManagerService, times(1)).performAccessibilityShortcut(null);
        verify(mAccessibilityManagerService, times(1)).performAccessibilityShortcut(null);
    }
    }