Document the split-screen action

The split-screen behavior is changed, so systemui doesn't
support this action with a single activity. We don't handle
this action by default from sc-v2. If SystemUI has any behavior
changed, they could register this action to support it.

Bug: 207056257
Test: presubmit pass
Change-Id: If569eff1ac52601e6b88324d7b47630a53e198f2
This commit is contained in:
ryanlwlin
2021-12-02 13:36:12 +08:00
parent f5fe79dedc
commit 1ad80ead92
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();