Merge "Use finally block for Binder.restoreCallingIdentity" into sc-dev-plus-aosp

This commit is contained in:
TreeHugger Robot
2021-06-02 18:14:12 +00:00
committed by Android (Google) Code Review

View File

@@ -614,8 +614,12 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
}
// waive WRITE_SECURE_SETTINGS permission check
final 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);
}
}
/**