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

Commit fecc98e2 authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Fix FRP setting write failure due to calling identity

Test: Verify with GMS Core
Bug: 338214895
Change-Id: Ie51cd809ce0ff2e3da612975c4e68c41274a7e20
parent dc336859
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -291,9 +291,15 @@ public class PersistentDataBlockService extends SystemService {

    private void setOldSettingForBackworkCompatibility(boolean isActive) {
        // Set the SECURE_FRP_MODE flag, for backward compatibility with clients who use it.
        // They should switch to calling #isFrpActive().
        // They should switch to calling #isFrpActive().  Clear calling ID since this can happen
        // during an app call.
        final long callingId = Binder.clearCallingIdentity();
        try {
            Settings.Global.putInt(mContext.getContentResolver(),
                    Settings.Global.SECURE_FRP_MODE, isActive ? 1 : 0);
        } finally {
            Binder.restoreCallingIdentity(callingId);
        }
    }

    private void setOemUnlockEnabledProperty(boolean oemUnlockEnabled) {