Merge "Document the split-screen action" into sc-v2-dev

This commit is contained in:
Ryan Lin
2021-12-10 00:53:49 +00:00
committed by Android (Google) Code Review
3 changed files with 3 additions and 26 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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();