Loading services/accessibility/accessibility.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -82,16 +82,6 @@ flag { } } flag { name: "manager_avoid_receiver_timeout" namespace: "accessibility" description: "Avoid broadcast receiver timeout by offloading potentially slow operations to the background thread." bug: "333890389" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "pinch_zoom_zero_min_span" namespace: "accessibility" Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +31 −49 Original line number Diff line number Diff line Loading @@ -1028,10 +1028,37 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub "context=" + context + ";intent=" + intent); } if (com.android.server.accessibility.Flags.managerAvoidReceiverTimeout()) { BackgroundThread.getHandler().post(() -> processBroadcast(intent)); } else { processBroadcast(intent); String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { switchUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) { unlockUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_SETTING_RESTORED.equals(action)) { final String which = intent.getStringExtra(Intent.EXTRA_SETTING_NAME); if (Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(which)) { synchronized (mLock) { restoreEnabledAccessibilityServicesLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED.equals(which)) { synchronized (mLock) { restoreLegacyDisplayMagnificationNavBarIfNeededLocked( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS.equals(which)) { synchronized (mLock) { restoreAccessibilityButtonTargetsLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } } } }, UserHandle.ALL, intentFilter, null, null); Loading Loading @@ -1954,19 +1981,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mA11yWindowManager.onTouchInteractionEnd(); } private void processBroadcast(Intent intent) { String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { switchUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) { unlockUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_SETTING_RESTORED.equals(action)) { restoreSetting(intent); } } @VisibleForTesting void switchUser(int userId) { mMagnificationController.updateUserIdIfNeeded(userId); Loading Loading @@ -2065,38 +2079,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub getMagnificationController().onUserRemoved(userId); } private void restoreSetting(Intent intent) { final String which = intent.getStringExtra(Intent.EXTRA_SETTING_NAME); if (Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(which)) { synchronized (mLock) { restoreEnabledAccessibilityServicesLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED.equals(which)) { synchronized (mLock) { restoreLegacyDisplayMagnificationNavBarIfNeededLocked( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS.equals(which)) { synchronized (mLock) { restoreAccessibilityButtonTargetsLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } else if (Settings.Secure.ACCESSIBILITY_QS_TARGETS.equals(which)) { if (!android.view.accessibility.Flags.a11yQsShortcut()) { return; } restoreAccessibilityQsTargets( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } // Called only during settings restore; currently supports only the owner user // TODO: http://b/22388012 void restoreEnabledAccessibilityServicesLocked(String oldSetting, String newSetting, Loading Loading
services/accessibility/accessibility.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -82,16 +82,6 @@ flag { } } flag { name: "manager_avoid_receiver_timeout" namespace: "accessibility" description: "Avoid broadcast receiver timeout by offloading potentially slow operations to the background thread." bug: "333890389" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "pinch_zoom_zero_min_span" namespace: "accessibility" Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +31 −49 Original line number Diff line number Diff line Loading @@ -1028,10 +1028,37 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub "context=" + context + ";intent=" + intent); } if (com.android.server.accessibility.Flags.managerAvoidReceiverTimeout()) { BackgroundThread.getHandler().post(() -> processBroadcast(intent)); } else { processBroadcast(intent); String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { switchUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) { unlockUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_SETTING_RESTORED.equals(action)) { final String which = intent.getStringExtra(Intent.EXTRA_SETTING_NAME); if (Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(which)) { synchronized (mLock) { restoreEnabledAccessibilityServicesLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED.equals(which)) { synchronized (mLock) { restoreLegacyDisplayMagnificationNavBarIfNeededLocked( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS.equals(which)) { synchronized (mLock) { restoreAccessibilityButtonTargetsLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } } } }, UserHandle.ALL, intentFilter, null, null); Loading Loading @@ -1954,19 +1981,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mA11yWindowManager.onTouchInteractionEnd(); } private void processBroadcast(Intent intent) { String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { switchUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_UNLOCKED.equals(action)) { unlockUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_SETTING_RESTORED.equals(action)) { restoreSetting(intent); } } @VisibleForTesting void switchUser(int userId) { mMagnificationController.updateUserIdIfNeeded(userId); Loading Loading @@ -2065,38 +2079,6 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub getMagnificationController().onUserRemoved(userId); } private void restoreSetting(Intent intent) { final String which = intent.getStringExtra(Intent.EXTRA_SETTING_NAME); if (Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(which)) { synchronized (mLock) { restoreEnabledAccessibilityServicesLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED.equals(which)) { synchronized (mLock) { restoreLegacyDisplayMagnificationNavBarIfNeededLocked( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE), intent.getIntExtra(Intent.EXTRA_SETTING_RESTORED_FROM_SDK_INT, 0)); } } else if (Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS.equals(which)) { synchronized (mLock) { restoreAccessibilityButtonTargetsLocked( intent.getStringExtra(Intent.EXTRA_SETTING_PREVIOUS_VALUE), intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } else if (Settings.Secure.ACCESSIBILITY_QS_TARGETS.equals(which)) { if (!android.view.accessibility.Flags.a11yQsShortcut()) { return; } restoreAccessibilityQsTargets( intent.getStringExtra(Intent.EXTRA_SETTING_NEW_VALUE)); } } // Called only during settings restore; currently supports only the owner user // TODO: http://b/22388012 void restoreEnabledAccessibilityServicesLocked(String oldSetting, String newSetting, Loading