am 1b09c97d: am 4447405d: Merge "Callback on correct method when status is unsuccessful." into klp-modular-dev
* commit '1b09c97d8a7156a9f35ebab3c98db7b103852a58': Callback on correct method when status is unsuccessful.
This commit is contained in:
@@ -1986,7 +1986,13 @@ public final class BluetoothAdapter {
|
|||||||
public void onAdvertiseStateChange(int advertiseState, int status) {
|
public void onAdvertiseStateChange(int advertiseState, int status) {
|
||||||
Log.d(TAG, "on advertise call back, state: " + advertiseState + " status: " + status);
|
Log.d(TAG, "on advertise call back, state: " + advertiseState + " status: " + status);
|
||||||
if (advertiseState == STATE_ADVERTISE_STARTED) {
|
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 {
|
} else {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (status == ADVERTISE_CALLBACK_SUCCESS) {
|
if (status == ADVERTISE_CALLBACK_SUCCESS) {
|
||||||
@@ -2008,7 +2014,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