Clear calling identify when persisting volume behavior
External callers won't have required permissions to persist the Settings. Bug: 159994127 Test: manaul Change-Id: I7d5b01467052ad06e2204b96430def9fc9f939c6
This commit is contained in:
@@ -9002,10 +9002,15 @@ public class AudioService extends IAudioService.Stub
|
||||
if (DEBUG_VOL) {
|
||||
Log.d(TAG, "Persisting Volume Behavior for DeviceType: " + deviceType);
|
||||
}
|
||||
System.putIntForUser(mContentResolver,
|
||||
getSettingsNameForDeviceVolumeBehavior(deviceType),
|
||||
deviceVolumeBehavior,
|
||||
UserHandle.USER_CURRENT);
|
||||
long callingIdentity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
System.putIntForUser(mContentResolver,
|
||||
getSettingsNameForDeviceVolumeBehavior(deviceType),
|
||||
deviceVolumeBehavior,
|
||||
UserHandle.USER_CURRENT);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(callingIdentity);
|
||||
}
|
||||
}
|
||||
|
||||
@AudioManager.DeviceVolumeBehaviorState
|
||||
|
||||
Reference in New Issue
Block a user