Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58aee2ac authored by Wei Wang's avatar Wei Wang Committed by Android Git Automerger
Browse files

am ab4fc115: am 1b09c97d: am 4447405d: Merge "Callback on correct method when...

am ab4fc115: am 1b09c97d: am 4447405d: Merge "Callback on correct method when status is unsuccessful." into klp-modular-dev

* commit 'ab4fc115':
  Callback on correct method when status is unsuccessful.
parents 1be2c0fc ab4fc115
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -1986,7 +1986,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) {
                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) {
@@ -2008,7 +2014,13 @@ public final class BluetoothAdapter {
                        }
                    }
                }
                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);
                }
            }
        }
    }