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

Commit 82001e6b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Revert "Bluetooth: Handle invalid BT service while getting the BT state""

parents f4c4f201 bc6b4fc3
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -470,14 +470,6 @@ public final class BluetoothAdapter {
     * @return current state of Bluetooth adapter
     */
    public int getState() {
        if (mService == null) {
            if (DBG) Log.d(TAG, "" + hashCode() + ": getState() :  mService = null");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ie) {
                if (DBG) Log.d(TAG, ": getState() :  Exception in thread sleep");
            }
        }
        try {
            synchronized(mManagerCallback) {
                if (mService != null)
@@ -486,6 +478,8 @@ public final class BluetoothAdapter {
                    if (VDBG) Log.d(TAG, "" + hashCode() + ": getState(). Returning " + state);
                    return state;
                }
                // TODO(BT) there might be a small gap during STATE_TURNING_ON that
                //          mService is null, handle that case
            }
        } catch (RemoteException e) {Log.e(TAG, "", e);}
        if (DBG) Log.d(TAG, "" + hashCode() + ": getState() :  mService = null. Returning STATE_OFF");