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

Commit 994fb3a0 authored by Peter_Liang's avatar Peter_Liang Committed by PETER LIANG
Browse files

Add the intent extra for accessibility long press event.

Must add the intent extra EXTRA_SHORTCUT_TYPE to launch the activity.

Bug: 149444165
Bug: 149292053
Test: manual test
Change-Id: I11c1999e3d0740774b13d9e49e92c9cf66de7afc
parent c228e1d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -352,6 +352,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
            try {
                Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                intent.putExtra(AccessibilityManager.EXTRA_SHORTCUT_TYPE,
                        AccessibilityManager.ACCESSIBILITY_BUTTON);
                mContext.startActivityAsUser(intent, UserHandle.CURRENT);
            } finally {
                Binder.restoreCallingIdentity(token);
+2 −0
Original line number Diff line number Diff line
@@ -956,6 +956,8 @@ public class NavigationBarFragment extends LifecycleFragment implements Callback
    private boolean onAccessibilityLongClick(View v) {
        Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        intent.putExtra(AccessibilityManager.EXTRA_SHORTCUT_TYPE,
                AccessibilityManager.ACCESSIBILITY_BUTTON);
        v.getContext().startActivityAsUser(intent, UserHandle.CURRENT);
        return true;
    }