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

Commit 9b9ca65d authored by Bo Hu's avatar Bo Hu Committed by Android (Google) Code Review
Browse files

Merge "Emulator: avoid accessing null BluetoothAdapter" into nyc-dev

parents fa3816d7 625bc4bd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -496,8 +496,9 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem

        @Override
        public void setListening(boolean listening) {
            if (listening) {
            BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
            if (defaultAdapter == null) return;
            if (listening) {
                mEnabled = defaultAdapter.isEnabled();
                mConnected =
                        defaultAdapter.getConnectionState() == BluetoothAdapter.STATE_CONNECTED;