diff options
| -rw-r--r-- | services/core/java/com/android/server/pdb/PersistentDataBlockService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/pdb/PersistentDataBlockService.java b/services/core/java/com/android/server/pdb/PersistentDataBlockService.java index 2c1453261808..c5e2bb87afd3 100644 --- a/services/core/java/com/android/server/pdb/PersistentDataBlockService.java +++ b/services/core/java/com/android/server/pdb/PersistentDataBlockService.java @@ -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(). - Settings.Global.putInt(mContext.getContentResolver(), - Settings.Global.SECURE_FRP_MODE, isActive ? 1 : 0); + // 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) { |