summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Svetoslav Ganov <svetoslavganov@google.com> 2012-06-04 14:02:09 -0700
committer Svetoslav Ganov <svetoslavganov@google.com> 2012-06-04 14:06:45 -0700
commitc682fc965df2518a95d23e39ec51d788100d20ec (patch)
treea02d8929659cd08ed5ba9532d4b6b079a3fe1a0c
parent01827ce9f2d5f4441c7f7b0211d2739824320daf (diff)
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
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 3e8f51279430..41f4e008bd57 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -73,6 +73,7 @@ import android.view.accessibility.IAccessibilityManagerClient;
import com.android.internal.R;
import com.android.internal.content.PackageMonitor;
+import com.android.internal.statusbar.IStatusBarService;
import com.android.server.wm.WindowManagerService;
import org.xmlpull.v1.XmlPullParserException;
@@ -1535,7 +1536,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
sendDownAndUpKeyEvents(KeyEvent.KEYCODE_HOME);
} return true;
case AccessibilityService.GLOBAL_ACTION_RECENTS: {
- sendDownAndUpKeyEvents(KeyEvent.KEYCODE_APP_SWITCH);
+ openRecents();
} return true;
case AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS: {
expandStatusBar();
@@ -1728,6 +1729,20 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
Binder.restoreCallingIdentity(token);
}
+ private void openRecents() {
+ final long token = Binder.clearCallingIdentity();
+
+ IStatusBarService statusBarService = IStatusBarService.Stub.asInterface(
+ ServiceManager.getService("statusbar"));
+ try {
+ statusBarService.toggleRecentApps();
+ } catch (RemoteException e) {
+ Slog.e(LOG_TAG, "Error toggling recent apps.");
+ }
+
+ Binder.restoreCallingIdentity(token);
+ }
+
private IAccessibilityInteractionConnection getConnectionLocked(int windowId) {
if (DEBUG) {
Slog.i(LOG_TAG, "Trying to get interaction connection to windowId: " + windowId);