Merge "Use finally block for Binder.restoreCallingIdentity"

This commit is contained in:
Treehugger Robot
2021-06-03 20:05:50 +00:00
committed by Gerrit Code Review

View File

@@ -601,9 +601,13 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
} }
// waive WRITE_SECURE_SETTINGS permission check // waive WRITE_SECURE_SETTINGS permission check
long callingIdentity = Binder.clearCallingIdentity(); long callingIdentity = Binder.clearCallingIdentity();
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.BLUETOOTH_ON, value); try {
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.BLUETOOTH_ON, value);
} finally {
Binder.restoreCallingIdentity(callingIdentity); Binder.restoreCallingIdentity(callingIdentity);
} }
}
/** /**
* Returns true if the Bluetooth Adapter's name and address is * Returns true if the Bluetooth Adapter's name and address is