Merge "Implement the global accessibility action to expand notifications." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0bef72450b
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user