Merge "Verify BluetoothDevice is not null before calling BluetoothHearingAid System APIs" am: 1ed4e81385

Change-Id: I3ab6b4458babf1bfd43c89fb74ae451cf05f9022
This commit is contained in:
Treehugger Robot
2020-03-26 10:25:32 +00:00
committed by Automerger Merge Worker

View File

@@ -171,7 +171,8 @@ public class HandsFreeProfileOutputPreferenceController extends AudioSwitchPrefe
if (hapProfile != null && hfpProfile != null && device == null) { if (hapProfile != null && hfpProfile != null && device == null) {
hfpProfile.setActiveDevice(null); hfpProfile.setActiveDevice(null);
hapProfile.setActiveDevice(null); hapProfile.setActiveDevice(null);
} else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { } else if (hapProfile != null && device != null
&& hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) {
hapProfile.setActiveDevice(device); hapProfile.setActiveDevice(device);
} else if (hfpProfile != null) { } else if (hfpProfile != null) {
hfpProfile.setActiveDevice(device); hfpProfile.setActiveDevice(device);