Skip to content

Commit c682fc9

Browse files
committed
Global accessibility action to open recent apps shows the old dialog style.
1. The global action to open recent apps shows the old dialog style rent apps panel. Apparently the key code to open recent apps is not opening the new UI so the AccessibilityManagerService is calling directly the method on the IStatusBarSerivce to do so. bug:6607664 Change-Id: I94c1963b07947776bf1c2448903b26f3603f9a59
1 parent 01827ce commit c682fc9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

services/java/com/android/server/accessibility/AccessibilityManagerService.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373

7474
import com.android.internal.R;
7575
import com.android.internal.content.PackageMonitor;
76+
import com.android.internal.statusbar.IStatusBarService;
7677
import com.android.server.wm.WindowManagerService;
7778

7879
import org.xmlpull.v1.XmlPullParserException;
@@ -1535,7 +1536,7 @@ public boolean performGlobalAction(int action) {
15351536
sendDownAndUpKeyEvents(KeyEvent.KEYCODE_HOME);
15361537
} return true;
15371538
case AccessibilityService.GLOBAL_ACTION_RECENTS: {
1538-
sendDownAndUpKeyEvents(KeyEvent.KEYCODE_APP_SWITCH);
1539+
openRecents();
15391540
} return true;
15401541
case AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS: {
15411542
expandStatusBar();
@@ -1728,6 +1729,20 @@ private void expandStatusBar() {
17281729
Binder.restoreCallingIdentity(token);
17291730
}
17301731

1732+
private void openRecents() {
1733+
final long token = Binder.clearCallingIdentity();
1734+
1735+
IStatusBarService statusBarService = IStatusBarService.Stub.asInterface(
1736+
ServiceManager.getService("statusbar"));
1737+
try {
1738+
statusBarService.toggleRecentApps();
1739+
} catch (RemoteException e) {
1740+
Slog.e(LOG_TAG, "Error toggling recent apps.");
1741+
}
1742+
1743+
Binder.restoreCallingIdentity(token);
1744+
}
1745+
17311746
private IAccessibilityInteractionConnection getConnectionLocked(int windowId) {
17321747
if (DEBUG) {
17331748
Slog.i(LOG_TAG, "Trying to get interaction connection to windowId: " + windowId);

0 commit comments

Comments
 (0)