Merge "clear calling identity before calling settings provider" into oc-dev

This commit is contained in:
TreeHugger Robot
2017-04-12 22:09:19 +00:00
committed by Android (Google) Code Review

View File

@@ -2036,10 +2036,16 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
}
if (!shortcutServiceIsInstalled) {
userState.mServiceToEnableWithShortcut = null;
Settings.Secure.putStringForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, null, userState.mUserId);
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_SHORTCUT_ENABLED, 0, userState.mUserId);
final long identity = Binder.clearCallingIdentity();
try {
Settings.Secure.putStringForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, null, userState.mUserId);
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.ACCESSIBILITY_SHORTCUT_ENABLED, 0, userState.mUserId);
} finally {
Binder.restoreCallingIdentity(identity);
}
}
}