summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-09-25 16:07:46 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-09-25 16:07:59 -0700
commite20a177d3f147f3011647c3bdab401f90b2c5d1d (patch)
tree9f06e8e43907e4ea01dc7456865ff39f871749b9 /services
parent1ab8a08a9b85aa62045a6a78fd93859382c88b0f (diff)
downloadframeworks_base-e20a177d3f147f3011647c3bdab401f90b2c5d1d.zip
frameworks_base-e20a177d3f147f3011647c3bdab401f90b2c5d1d.tar.gz
frameworks_base-e20a177d3f147f3011647c3bdab401f90b2c5d1d.tar.bz2
Adding a global accessibility action to open quick settings.
1. Added APIs for opening the quick settings to the StatusBarManagerService and the local StatausBarManager. The new APIs are protected by the old EXPAND_STATUS_BAR permission. Renamed the expand* and collapse* non-public APIs that are expanding the notifications to expandNotifications* collapseNotifications* to better convey what they do given that this change adds expandQuickSettings* and collapseQuickSettings*. Added a global action to the accessibility layer to expand the quick settings which is calling into the new status bar manager APIs. bug:7030487 Change-Id: Ic7b46e1a132f1c0d71355f18e7c5a9a2424171c3
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/StatusBarManagerService.java33
-rw-r--r--services/java/com/android/server/accessibility/AccessibilityManagerService.java21
2 files changed, 45 insertions, 9 deletions
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 9f53fad..29608a2 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -116,23 +116,45 @@ public class StatusBarManagerService extends IStatusBarService.Stub
// ================================================================================
// From IStatusBarService
// ================================================================================
- public void expand() {
+ public void expandNotifications() {
enforceExpandStatusBar();
if (mBar != null) {
try {
- mBar.animateExpand();
+ mBar.animateExpandNotifications();
} catch (RemoteException ex) {
}
}
}
- public void collapse() {
+ public void collapseNotifications() {
enforceExpandStatusBar();
if (mBar != null) {
try {
- mBar.animateCollapse();
+ mBar.animateCollapseNotifications();
+ } catch (RemoteException ex) {
+ }
+ }
+ }
+
+ public void expandQuickSettings() {
+ enforceExpandStatusBar();
+
+ if (mBar != null) {
+ try {
+ mBar.animateExpandQuickSettings();
+ } catch (RemoteException ex) {
+ }
+ }
+ }
+
+ public void collapseQuickSettings() {
+ enforceExpandStatusBar();
+
+ if (mBar != null) {
+ try {
+ mBar.animateCollapseQuickSettings();
} catch (RemoteException ex) {
}
}
@@ -596,7 +618,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub
String action = intent.getAction();
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)
|| Intent.ACTION_SCREEN_OFF.equals(action)) {
- collapse();
+ collapseNotifications();
+ collapseQuickSettings();
}
/*
else if (Telephony.Intents.SPN_STRINGS_UPDATED_ACTION.equals(action)) {
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index 0e101e1..2854d01 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -1707,7 +1707,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
return true;
}
- public boolean performGlobalAction(int action) throws RemoteException {
+ public boolean performGlobalAction(int action) {
synchronized (mLock) {
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
@@ -1729,7 +1729,10 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
openRecents();
} return true;
case AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS: {
- expandStatusBar();
+ expandNotifications();
+ } return true;
+ case AccessibilityService.GLOBAL_ACTION_QUICK_SETTINGS: {
+ expandQuickSettings();
} return true;
}
return false;
@@ -1901,12 +1904,22 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
Binder.restoreCallingIdentity(token);
}
- private void expandStatusBar() {
+ private void expandNotifications() {
+ final long token = Binder.clearCallingIdentity();
+
+ StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService(
+ android.app.Service.STATUS_BAR_SERVICE);
+ statusBarManager.expandNotifications();
+
+ Binder.restoreCallingIdentity(token);
+ }
+
+ private void expandQuickSettings() {
final long token = Binder.clearCallingIdentity();
StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService(
android.app.Service.STATUS_BAR_SERVICE);
- statusBarManager.expand();
+ statusBarManager.expandQuickSettings();
Binder.restoreCallingIdentity(token);
}