File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
services/java/com/android/server/accessibility Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 7373
7474import com .android .internal .R ;
7575import com .android .internal .content .PackageMonitor ;
76+ import com .android .internal .statusbar .IStatusBarService ;
7677import com .android .server .wm .WindowManagerService ;
7778
7879import org .xmlpull .v1 .XmlPullParserException ;
@@ -1537,7 +1538,7 @@ public boolean performGlobalAction(int action) {
15371538 sendDownAndUpKeyEvents (KeyEvent .KEYCODE_HOME );
15381539 } return true ;
15391540 case AccessibilityService .GLOBAL_ACTION_RECENTS : {
1540- sendDownAndUpKeyEvents ( KeyEvent . KEYCODE_APP_SWITCH );
1541+ openRecents ( );
15411542 } return true ;
15421543 case AccessibilityService .GLOBAL_ACTION_NOTIFICATIONS : {
15431544 expandStatusBar ();
@@ -1730,6 +1731,20 @@ private void expandStatusBar() {
17301731 Binder .restoreCallingIdentity (token );
17311732 }
17321733
1734+ private void openRecents () {
1735+ final long token = Binder .clearCallingIdentity ();
1736+
1737+ IStatusBarService statusBarService = IStatusBarService .Stub .asInterface (
1738+ ServiceManager .getService ("statusbar" ));
1739+ try {
1740+ statusBarService .toggleRecentApps ();
1741+ } catch (RemoteException e ) {
1742+ Slog .e (LOG_TAG , "Error toggling recent apps." );
1743+ }
1744+
1745+ Binder .restoreCallingIdentity (token );
1746+ }
1747+
17331748 private IAccessibilityInteractionConnection getConnectionLocked (int windowId ) {
17341749 if (DEBUG ) {
17351750 Slog .i (LOG_TAG , "Trying to get interaction connection to windowId: " + windowId );
You can’t perform that action at this time.
0 commit comments