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

Commit de543bc3 authored by Matadeen Mishra's avatar Matadeen Mishra Committed by Linux Build Service Account
Browse files

BT: Set persiste Bluetooth State during enable timeout case

Use case: When enable timeout occurs during S&S testing and
Bluetooth state is moved from Turning On to Off.

Steps: Changes related to enable timeout case, to test the
changes, S&S testing can be done.

Failure: Changes done to handle Bluetooth enable timeout
case when Bluetooth state changes from Turning On to Off.

Root cause: Setting Bluetooth Persist state to handle the
enable timeout case so that Bluetooth doesnot self enable
after enable timeout case is handled.

Fix: Setting the Bluetooth Persist State to Off when enable
timeout occurs.

CRs-Fixed: 1006444
Change-Id: I17b3b05020eb7469666e6d8c88c86df7764b4024
parent b5068d6f
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2084,6 +2084,8 @@ public final class BluetoothAdapter {
                }

                synchronized (mProxyServiceStateCallbacks) {
                    Log.d(TAG, "onBluetoothServiceDown: Sending callbacks to " +
                                    mProxyServiceStateCallbacks.size() + " clients");
                    for (IBluetoothManagerCallback cb : mProxyServiceStateCallbacks ){
                        try {
                            if (cb != null) {
@@ -2091,11 +2093,10 @@ public final class BluetoothAdapter {
                            } else {
                                Log.d(TAG, "onBluetoothServiceDown: cb is null!!!");
                            }
                        } catch (Exception e) {
                            Log.e(TAG,"",e);
                        }
                        } catch (Exception e)  { Log.e(TAG,"",e);}
                    }
                }
                Log.d(TAG, "onBluetoothServiceDown: Finished sending callbacks to registered clients");
            }

            public void onBrEdrDown() {
+6 −1
Original line number Diff line number Diff line
@@ -1140,6 +1140,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                            (mBluetooth != null) && mEnable) {
                        recoverBluetoothServiceFromError();
                    }
                    if ((prevState == BluetoothAdapter.STATE_TURNING_ON) &&
                            (newState == BluetoothAdapter.STATE_OFF) &&
                            (mBluetooth != null) && mEnable) {
                         persistBluetoothSetting(BLUETOOTH_OFF);
                    }
                    if ((prevState == BluetoothAdapter.STATE_TURNING_ON) &&
                           (newState == BluetoothAdapter.STATE_BLE_ON) &&
                           (mBluetooth != null) && mEnable) {