Merge "Merge "Document the split-screen action" into sc-v2-dev am: 93124d69fc am: 75309bcd38"
This commit is contained in:
committed by
Android (Google) Code Review
commit
98d4b6d3b3
@@ -521,7 +521,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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user