Remove mIsRegistered check for setUwbEnabled

Settings is the only client that uses the setUwbEnabled API and does not
need to register a callback.
Bug: 190599683
Test: CTS and Robotest

Change-Id: I2f360189c03b74f2636410dc21fda7041a35f376
This commit is contained in:
Joy Babafemi
2021-06-11 04:03:52 +00:00
parent 466698f9af
commit b0da70ba29

View File

@@ -108,16 +108,13 @@ public class AdapterStateListener extends IUwbAdapterStateCallbacks.Stub {
*/
public void setEnabled(boolean isEnabled) {
synchronized (this) {
if (!mIsRegistered) {
return;
} else {
try {
mAdapter.setEnabled(isEnabled);
} catch (RemoteException e) {
Log.w(TAG, "Failed to set adapter state");
throw e.rethrowFromSystemServer();
}
try {
mAdapter.setEnabled(isEnabled);
} catch (RemoteException e) {
Log.w(TAG, "Failed to set adapter state");
throw e.rethrowFromSystemServer();
}
}
}