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

Commit 35ba7ec5 authored by Tony Mak's avatar Tony Mak
Browse files

clear calling identity before calling settings provider

Test: Run a instrumentation test
cts-tradefed run cts-dev --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest#testPhoneAccountVisibility

Change-Id: I29b1dc307e9e127b919aebe4d83ab6311ce36f2d
Fix: 34320197
parent 264f2e40
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2036,10 +2036,16 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
        }
        if (!shortcutServiceIsInstalled) {
            userState.mServiceToEnableWithShortcut = null;
            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);
            }
        }
    }