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

Commit 0a278b12 authored by Ajay Panicker's avatar Ajay Panicker Committed by Android (Google) Code Review
Browse files

Merge "Get adapter name and address on boot" into nyc-dev

parents cea9f353 bf796d87
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -761,6 +761,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
        if (mEnableExternal && isBluetoothPersistedStateOnBluetooth()) {
            if (DBG) Slog.d(TAG, "Auto-enabling Bluetooth.");
            sendEnableMsg(mQuietEnableExternal);
        } else if (!isNameAndAddressSet()) {
            if (DBG) Slog.d(TAG, "Getting adapter name and address");
            enable();
            waitForOnOff(true, false);
            disable(true);
        }
    }

@@ -1001,6 +1006,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                }
            }
        }

        // mAddress is accessed from outside.
        // It is alright without a lock. Here, bluetooth is off, no other thread is
        // changing mAddress
@@ -1181,6 +1187,15 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                            Slog.e(TAG,"Unable to call configHciSnoopLog", e);
                        }

                        if (!isNameAndAddressSet()) {
                            try {
                                storeNameAndAddress(mBluetooth.getName(),
                                                    mBluetooth.getAddress());
                            } catch (RemoteException re) {
                                Slog.e(TAG, "Unable to grab names", re);
                            }
                        }

                        //Register callback object
                        try {
                            mBluetooth.registerCallback(mBluetoothCallback);