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

Commit 75309bcd authored by Ryan Lin's avatar Ryan Lin Committed by Automerger Merge Worker
Browse files

Merge "Document the split-screen action" into sc-v2-dev am: 93124d69

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16375117

Change-Id: I3061d1fbbf4f6712ee5de7090ce5a72df5f962e8
parents fa693ff4 93124d69
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -518,7 +518,9 @@ public abstract class AccessibilityService extends Service {
    public static final int GLOBAL_ACTION_POWER_DIALOG = 6;

    /**
     * Action to toggle docking the current app's window
     * Action to toggle docking the current app's window.
     * <p>
     * <strong>Note:</strong>  It is effective only if it appears in {@link #getSystemActions()}.
     */
    public static final int GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN = 7;

+0 −17
Original line number Diff line number Diff line
@@ -288,8 +288,6 @@ public class SystemActionPerformer {
                    showGlobalActions();
                    return true;
                }
                case AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN:
                    return toggleSplitScreen();
                case AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN:
                    return lockScreen();
                case AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT:
@@ -369,21 +367,6 @@ public class SystemActionPerformer {
        mWindowManagerService.showGlobalActions();
    }

    private boolean toggleSplitScreen() {
        final long token = Binder.clearCallingIdentity();
        try {
            StatusBarManagerInternal statusBarService = LocalServices.getService(
                    StatusBarManagerInternal.class);
            if (statusBarService == null) {
                return false;
            }
            statusBarService.toggleSplitScreen();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
        return true;
    }

    private boolean lockScreen() {
        mContext.getSystemService(PowerManager.class).goToSleep(SystemClock.uptimeMillis(),
                PowerManager.GO_TO_SLEEP_REASON_ACCESSIBILITY, 0);
+0 −8
Original line number Diff line number Diff line
@@ -295,14 +295,6 @@ public class SystemActionPerformerTest {
        verify(mMockWindowManagerInternal).showGlobalActions();
    }

    @Test
    public void testToggleSplitScreen_legacy() {
        setupWithRealContext();
        mSystemActionPerformer.performSystemAction(
                AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN);
        verify(mMockStatusBarManagerInternal).toggleSplitScreen();
    }

    @Test
    public void testScreenshot_requestsFromScreenshotHelper_legacy() {
        setupWithMockContext();