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

Commit 4447405d authored by Wei Wang's avatar Wei Wang Committed by Android (Google) Code Review
Browse files

Merge "Callback on correct method when status is unsuccessful." into klp-modular-dev

parents e9eb58c9 c07a5dd7
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -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) {
                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 {
                        }
                    }
                }
                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);
                }
            }
        }
    }