Merge "Use finally block for Binder.restoreCallingIdentity" am: d6eba76780

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1722680

Change-Id: I9fb2471c55167155e0f91644c22400329e69a5f6
This commit is contained in:
Treehugger Robot
2021-06-03 20:08:50 +00:00
committed by Automerger Merge Worker

View File

@@ -601,8 +601,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
// waive WRITE_SECURE_SETTINGS permission check
long callingIdentity = Binder.clearCallingIdentity();
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.BLUETOOTH_ON, value);
Binder.restoreCallingIdentity(callingIdentity);
try {
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.BLUETOOTH_ON, value);
} finally {
Binder.restoreCallingIdentity(callingIdentity);
}
}
/**