am 0bef7245: Merge "Implement the global accessibility action to expand notifications." into jb-dev

* commit '0bef72450b954ab0254ab948f75a89d65af3808c':
  Implement the global accessibility action to expand notifications.
This commit is contained in:
Svetoslav Ganov
2012-05-15 13:44:13 -07:00
committed by Android Git Automerger

View File

@@ -25,6 +25,7 @@ import android.accessibilityservice.AccessibilityServiceInfo;
import android.accessibilityservice.IAccessibilityServiceClient;
import android.accessibilityservice.IAccessibilityServiceConnection;
import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -1343,7 +1344,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
sendDownAndUpKeyEvents(KeyEvent.KEYCODE_APP_SWITCH);
} return true;
case AccessibilityService.GLOBAL_ACTION_NOTIFICATIONS: {
// TODO: Implement when 6346026 is fixed.
expandStatusBar();
} return true;
}
return false;
@@ -1413,6 +1414,16 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
Binder.restoreCallingIdentity(token);
}
private void expandStatusBar() {
final long token = Binder.clearCallingIdentity();
StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService(
android.app.Service.STATUS_BAR_SERVICE);
statusBarManager.expand();
Binder.restoreCallingIdentity(token);
}
private IAccessibilityInteractionConnection getConnectionLocked(int windowId) {
if (DEBUG) {
Slog.i(LOG_TAG, "Trying to get interaction connection to windowId: " + windowId);