Merge "Improved multiuser support for A11y button/Magnification" into oc-dev

am: 9aa64e6cfa

Change-Id: Ia7a56ce9ddc39d1e9e5d814d593dba96c95ae957
This commit is contained in:
Casey Burkhardt
2017-04-12 19:14:04 +00:00
committed by android-build-merger
2 changed files with 8 additions and 5 deletions

View File

@@ -145,7 +145,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
getContext().getMainThreadHandler());
mContentResolver.registerContentObserver(Settings.Secure.getUriFor(
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED), false,
mMagnificationObserver);
mMagnificationObserver, UserHandle.USER_ALL);
if (savedInstanceState != null) {
mDisabledFlags1 = savedInstanceState.getInt(EXTRA_DISABLE_STATE, 0);
@@ -559,20 +559,23 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
private boolean onAccessibilityLongClick(View v) {
Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
v.getContext().startActivity(intent);
v.getContext().startActivityAsUser(intent, UserHandle.CURRENT);
return true;
}
private void updateAccessibilityServicesState() {
int requestingServices = 0;
try {
if (Settings.Secure.getInt(mContentResolver,
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED) == 1) {
if (Settings.Secure.getIntForUser(mContentResolver,
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED,
UserHandle.USER_CURRENT) == 1) {
requestingServices++;
}
} catch (Settings.SettingNotFoundException e) {
}
// AccessibilityManagerService resolves services for the current user since the local
// AccessibilityManager is created from a Context with the INTERACT_ACROSS_USERS permission
final List<AccessibilityServiceInfo> services =
mAccessibilityManager.getEnabledAccessibilityServiceList(
AccessibilityServiceInfo.FEEDBACK_ALL_MASK);

View File

@@ -1586,7 +1586,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
private void showAccessibilityButtonTargetSelection() {
Intent intent = new Intent(AccessibilityManager.ACTION_CHOOSE_ACCESSIBILITY_BUTTON);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
mContext.startActivity(intent);
mContext.startActivityAsUser(intent, UserHandle.of(mCurrentUserId));
}
private void scheduleNotifyClientsOfServicesStateChange(UserState userState) {