Skip to content

Commit ccf97dc

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Global accessibility action to open recent apps shows the old dialog style." into jb-dev
2 parents 5751f81 + c682fc9 commit ccf97dc

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;
@@ -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);

0 commit comments

Comments
 (0)