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

Commit 115622e9 authored by Phil Weaver's avatar Phil Weaver Committed by android-build-merger
Browse files

Add check for null manger for a11y recents action am: 25850331

am: 0cd036da

Change-Id: Ic10e13d83bd6cb2dab3b445e8b5ec41a45e08fa6
parents 74a9f0f6 0cd036da
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -334,7 +334,8 @@ public abstract class AccessibilityService extends Service {
    public static final int GLOBAL_ACTION_HOME = 2;

    /**
     * Action to toggle showing the overview of recent apps
     * Action to toggle showing the overview of recent apps. Will fail on platforms that don't
     * show recent apps.
     */
    public static final int GLOBAL_ACTION_RECENTS = 3;

+14 −9
Original line number Diff line number Diff line
@@ -2891,8 +2891,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
                        sendDownAndUpKeyEvents(KeyEvent.KEYCODE_HOME);
                    } return true;
                    case AccessibilityService.GLOBAL_ACTION_RECENTS: {
                        openRecents();
                    } return true;
                        return openRecents();
                    }
                    case AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS: {
                        expandNotifications();
                    } return true;
@@ -3385,15 +3385,20 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
            Binder.restoreCallingIdentity(token);
        }

        private void openRecents() {
        private boolean openRecents() {
            final long token = Binder.clearCallingIdentity();

            try {
                StatusBarManagerInternal statusBarService = LocalServices.getService(
                        StatusBarManagerInternal.class);
                if (statusBarService == null) {
                    return false;
                }
                statusBarService.toggleRecentApps();

            } finally {
                Binder.restoreCallingIdentity(token);
            }
            return true;
        }

        private void showGlobalActions() {
            mWindowManagerService.showGlobalActions();