Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bef7245 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Implement the global accessibility action to expand notifications." into jb-dev

parents 8414beac 5c89f44e
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -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);