am 4447405d: Merge "Callback on correct method when status is unsuccessful." into klp-modular-dev
* commit '4447405d76b5a9152aacadbfdefd1f8fd60a03ad': Callback on correct method when status is unsuccessful.
This commit is contained in:
@@ -1989,7 +1989,13 @@ public final class BluetoothAdapter {
|
||||
public void onAdvertiseStateChange(int advertiseState, int status) {
|
||||
Log.d(TAG, "on advertise call back, state: " + advertiseState + " status: " + status);
|
||||
if (advertiseState == STATE_ADVERTISE_STARTED) {
|
||||
mAdvertiseCallback.onAdvertiseStart(status);
|
||||
if (status == ADVERTISE_CALLBACK_SUCCESS) {
|
||||
mAdvertiseCallback.onAdvertiseStart(status);
|
||||
} else {
|
||||
// If status is unsuccessful and advertise state is started, it means stop
|
||||
// advertising fails.
|
||||
mAdvertiseCallback.onAdvertiseStop(status);
|
||||
}
|
||||
} else {
|
||||
synchronized (this) {
|
||||
if (status == ADVERTISE_CALLBACK_SUCCESS) {
|
||||
@@ -2011,7 +2017,13 @@ public final class BluetoothAdapter {
|
||||
}
|
||||
}
|
||||
}
|
||||
mAdvertiseCallback.onAdvertiseStop(status);
|
||||
if (status == ADVERTISE_CALLBACK_SUCCESS) {
|
||||
mAdvertiseCallback.onAdvertiseStop(status);
|
||||
} else{
|
||||
// If status is unsuccesful and advertise state is stopped, it means start
|
||||
// advertising fails.
|
||||
mAdvertiseCallback.onAdvertiseStart(status);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user