From e34560b21989eea54a139a0586d156ba573cc2ea Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 10 Jul 2014 14:50:06 -0700 Subject: Add accessibility action to open power long-press dialog Also fixes an infinite recursion bug in the WindowManagerService implementation of WindowManagerInternal. BUG: 16129909 Change-Id: I4f9d32f4e6c3ad460652c5e5271540fa5032a1f5 --- .../server/accessibility/AccessibilityManagerService.java | 7 +++++++ .../core/java/com/android/server/wm/WindowManagerService.java | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java index 1be1572..ee7eb9f 100644 --- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -2443,6 +2443,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { case AccessibilityService.GLOBAL_ACTION_QUICK_SETTINGS: { expandQuickSettings(); } return true; + case AccessibilityService.GLOBAL_ACTION_POWER_DIALOG: { + showGlobalActions(); + } return true; } return false; } finally { @@ -2781,6 +2784,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { Binder.restoreCallingIdentity(token); } + private void showGlobalActions() { + mWindowManagerService.showGlobalActions(); + } + private IAccessibilityInteractionConnection getConnectionLocked(int windowId) { if (DEBUG) { Slog.i(LOG_TAG, "Trying to get interaction connection to windowId: " + windowId); diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 771b53b..396ec8f 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -5171,6 +5171,10 @@ public class WindowManagerService extends IWindowManager.Stub } } + void showGlobalActions() { + mPolicy.showGlobalActions(); + } + @Override public void closeSystemDialogs(String reason) { synchronized(mWindowMap) { @@ -11130,7 +11134,12 @@ public class WindowManagerService extends IWindowManager.Stub @Override public boolean isKeyguardLocked() { - return isKeyguardLocked(); + return WindowManagerService.this.isKeyguardLocked(); + } + + @Override + public void showGlobalActions() { + WindowManagerService.this.showGlobalActions(); } @Override -- cgit v1.1