Merge "[LeAudioBroadcast] avoid the system register mBroadcastCallback again" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e2137ed5b3
@@ -87,9 +87,11 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Bluetooth service connected");
|
||||
}
|
||||
mService = (BluetoothLeBroadcast) proxy;
|
||||
mIsProfileReady = true;
|
||||
registerServiceCallBack(mExecutor, mBroadcastCallback);
|
||||
if(!mIsProfileReady) {
|
||||
mService = (BluetoothLeBroadcast) proxy;
|
||||
mIsProfileReady = true;
|
||||
registerServiceCallBack(mExecutor, mBroadcastCallback);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,8 +99,10 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Bluetooth service disconnected");
|
||||
}
|
||||
mIsProfileReady = false;
|
||||
unregisterServiceCallBack(mBroadcastCallback);
|
||||
if(mIsProfileReady) {
|
||||
mIsProfileReady = false;
|
||||
unregisterServiceCallBack(mBroadcastCallback);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user