Merge "Document the split-screen action" into sc-v2-dev
This commit is contained in:
@@ -518,7 +518,9 @@ public abstract class AccessibilityService extends Service {
|
|||||||
public static final int GLOBAL_ACTION_POWER_DIALOG = 6;
|
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;
|
public static final int GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN = 7;
|
||||||
|
|
||||||
|
|||||||
@@ -288,8 +288,6 @@ public class SystemActionPerformer {
|
|||||||
showGlobalActions();
|
showGlobalActions();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN:
|
|
||||||
return toggleSplitScreen();
|
|
||||||
case AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN:
|
case AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN:
|
||||||
return lockScreen();
|
return lockScreen();
|
||||||
case AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT:
|
case AccessibilityService.GLOBAL_ACTION_TAKE_SCREENSHOT:
|
||||||
@@ -369,21 +367,6 @@ public class SystemActionPerformer {
|
|||||||
mWindowManagerService.showGlobalActions();
|
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() {
|
private boolean lockScreen() {
|
||||||
mContext.getSystemService(PowerManager.class).goToSleep(SystemClock.uptimeMillis(),
|
mContext.getSystemService(PowerManager.class).goToSleep(SystemClock.uptimeMillis(),
|
||||||
PowerManager.GO_TO_SLEEP_REASON_ACCESSIBILITY, 0);
|
PowerManager.GO_TO_SLEEP_REASON_ACCESSIBILITY, 0);
|
||||||
|
|||||||
@@ -295,14 +295,6 @@ public class SystemActionPerformerTest {
|
|||||||
verify(mMockWindowManagerInternal).showGlobalActions();
|
verify(mMockWindowManagerInternal).showGlobalActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testToggleSplitScreen_legacy() {
|
|
||||||
setupWithRealContext();
|
|
||||||
mSystemActionPerformer.performSystemAction(
|
|
||||||
AccessibilityService.GLOBAL_ACTION_TOGGLE_SPLIT_SCREEN);
|
|
||||||
verify(mMockStatusBarManagerInternal).toggleSplitScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testScreenshot_requestsFromScreenshotHelper_legacy() {
|
public void testScreenshot_requestsFromScreenshotHelper_legacy() {
|
||||||
setupWithMockContext();
|
setupWithMockContext();
|
||||||
|
|||||||
Reference in New Issue
Block a user