Loading services/core/java/com/android/server/pdb/PersistentDataBlockService.java +12 −4 Original line number Diff line number Diff line Loading @@ -275,10 +275,7 @@ public class PersistentDataBlockService extends SystemService { if (mFrpEnforced) { automaticallyDeactivateFrpIfPossible(); setOemUnlockEnabledProperty(doGetOemUnlockEnabled()); // Set the SECURE_FRP_MODE flag, for backward compatibility with clients who use it. // They should switch to calling #isFrpActive(). Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.SECURE_FRP_MODE, mFrpActive ? 1 : 0); setOldSettingForBackworkCompatibility(mFrpActive); } else { formatIfOemUnlockEnabled(); } Loading @@ -292,6 +289,13 @@ public class PersistentDataBlockService extends SystemService { mInitDoneSignal.countDown(); } 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(). Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.SECURE_FRP_MODE, isActive ? 1 : 0); } private void setOemUnlockEnabledProperty(boolean oemUnlockEnabled) { setProperty(OEM_UNLOCK_PROP, oemUnlockEnabled ? "1" : "0"); } Loading Loading @@ -628,6 +632,7 @@ public class PersistentDataBlockService extends SystemService { Slog.w(TAG, "Upgrading from Android 14 or lower, defaulting FRP secret"); writeFrpMagicAndDefaultSecret(); mFrpActive = false; setOldSettingForBackworkCompatibility(mFrpActive); return true; } Loading Loading @@ -699,6 +704,7 @@ public class PersistentDataBlockService extends SystemService { void activateFrp() { synchronized (mLock) { mFrpActive = true; setOldSettingForBackworkCompatibility(mFrpActive); } } Loading Loading @@ -740,6 +746,7 @@ public class PersistentDataBlockService extends SystemService { if (MessageDigest.isEqual(secret, partitionSecret)) { mFrpActive = false; Slog.i(TAG, "FRP secret matched, FRP deactivated."); setOldSettingForBackworkCompatibility(mFrpActive); return true; } else { Slog.e(TAG, Loading Loading @@ -1315,6 +1322,7 @@ public class PersistentDataBlockService extends SystemService { public boolean deactivateFactoryResetProtectionWithoutSecret() { synchronized (mLock) { mFrpActive = false; setOldSettingForBackworkCompatibility(/* isActive */ mFrpActive); } return true; } Loading Loading
services/core/java/com/android/server/pdb/PersistentDataBlockService.java +12 −4 Original line number Diff line number Diff line Loading @@ -275,10 +275,7 @@ public class PersistentDataBlockService extends SystemService { if (mFrpEnforced) { automaticallyDeactivateFrpIfPossible(); setOemUnlockEnabledProperty(doGetOemUnlockEnabled()); // Set the SECURE_FRP_MODE flag, for backward compatibility with clients who use it. // They should switch to calling #isFrpActive(). Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.SECURE_FRP_MODE, mFrpActive ? 1 : 0); setOldSettingForBackworkCompatibility(mFrpActive); } else { formatIfOemUnlockEnabled(); } Loading @@ -292,6 +289,13 @@ public class PersistentDataBlockService extends SystemService { mInitDoneSignal.countDown(); } 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(). Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.SECURE_FRP_MODE, isActive ? 1 : 0); } private void setOemUnlockEnabledProperty(boolean oemUnlockEnabled) { setProperty(OEM_UNLOCK_PROP, oemUnlockEnabled ? "1" : "0"); } Loading Loading @@ -628,6 +632,7 @@ public class PersistentDataBlockService extends SystemService { Slog.w(TAG, "Upgrading from Android 14 or lower, defaulting FRP secret"); writeFrpMagicAndDefaultSecret(); mFrpActive = false; setOldSettingForBackworkCompatibility(mFrpActive); return true; } Loading Loading @@ -699,6 +704,7 @@ public class PersistentDataBlockService extends SystemService { void activateFrp() { synchronized (mLock) { mFrpActive = true; setOldSettingForBackworkCompatibility(mFrpActive); } } Loading Loading @@ -740,6 +746,7 @@ public class PersistentDataBlockService extends SystemService { if (MessageDigest.isEqual(secret, partitionSecret)) { mFrpActive = false; Slog.i(TAG, "FRP secret matched, FRP deactivated."); setOldSettingForBackworkCompatibility(mFrpActive); return true; } else { Slog.e(TAG, Loading Loading @@ -1315,6 +1322,7 @@ public class PersistentDataBlockService extends SystemService { public boolean deactivateFactoryResetProtectionWithoutSecret() { synchronized (mLock) { mFrpActive = false; setOldSettingForBackworkCompatibility(/* isActive */ mFrpActive); } return true; } Loading