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

Commit 1da99510 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "Fix NPE in BluetoothPairingController when comparing BluetoothClass"...

Merge "Fix NPE in BluetoothPairingController when comparing BluetoothClass" am: 9aa06f28 am: ce2edfa3

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2373748



Change-Id: I3346dba2aa9751bc77c17287dfe5d31759c05607
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 98e202f9 ce2edfa3
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothPairingDialogFragment.BluetoothPairingDialogListener;
import com.android.settings.core.SettingsUIDeviceConfig;
import com.android.settingslib.bluetooth.BluetoothUtils;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.bluetooth.LocalBluetoothProfile;
@@ -238,8 +239,8 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
            case BluetoothDevice.ACCESS_REJECTED:
                return false;
            default:
                if (mDevice.getBluetoothClass().getDeviceClass()
                        == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
                if (BluetoothUtils.isDeviceClassMatched(
                        mDevice, BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE)) {
                    return BluetoothDevice.EXTRA_PAIRING_INITIATOR_FOREGROUND == mInitiator;
                }
                return false;
@@ -253,8 +254,9 @@ public class BluetoothPairingController implements OnCheckedChangeListener,
     public void setContactSharingState() {
         final int permission = mDevice.getPhonebookAccessPermission();
         if (permission == BluetoothDevice.ACCESS_ALLOWED
                 || (permission == BluetoothDevice.ACCESS_UNKNOWN && mDevice.getBluetoothClass().
                        getDeviceClass() == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE)) {
                 || (permission == BluetoothDevice.ACCESS_UNKNOWN
                 && BluetoothUtils.isDeviceClassMatched(mDevice,
                 BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE))) {
             onCheckedChanged(null, true);
         } else {
             onCheckedChanged(null, false);