diff options
author | jackqdyulei <jackqdyulei@google.com> | 2018-09-18 15:07:49 -0700 |
---|---|---|
committer | jackqdyulei <jackqdyulei@google.com> | 2018-09-18 15:19:32 -0700 |
commit | 1bf730093c5460d3d93749bc151e9d3199edea48 (patch) | |
tree | cb906d894516d6d8b49e0cadb0f09c324e057170 /src/com/android/settings/sound | |
parent | e5791f3c99f23810310484e2adff14cd12d6e718 (diff) | |
download | packages_apps_Settings-1bf730093c5460d3d93749bc151e9d3199edea48.tar.gz packages_apps_Settings-1bf730093c5460d3d93749bc151e9d3199edea48.tar.bz2 packages_apps_Settings-1bf730093c5460d3d93749bc151e9d3199edea48.zip |
Fix incorrect API invoke for BT profiles
When hearing aid device has been set active, we shouldn't invoke
1. a2dpProfile.setActiveDevice()
2. hfpProfile.setActiveDevice()
Change-Id: Ie13dea041dd98d0cb9d913e1f28574b300095db9
Fixes: 113625278
Test: RunSettingsRoboTests
Diffstat (limited to 'src/com/android/settings/sound')
-rw-r--r-- | src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java | 7 | ||||
-rw-r--r-- | src/com/android/settings/sound/MediaOutputPreferenceController.java | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java b/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java index 0b50f5f2d7..a02c0b28b1 100644 --- a/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java +++ b/src/com/android/settings/sound/HandsFreeProfileOutputPreferenceController.java @@ -93,12 +93,9 @@ public class HandsFreeProfileOutputPreferenceController extends if (hapProfile != null && hfpProfile != null && device == null) { hfpProfile.setActiveDevice(null); hapProfile.setActiveDevice(null); - return; - } - if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { + } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); - } - if (hfpProfile != null) { + } else if (hfpProfile != null) { hfpProfile.setActiveDevice(device); } } diff --git a/src/com/android/settings/sound/MediaOutputPreferenceController.java b/src/com/android/settings/sound/MediaOutputPreferenceController.java index 8704243582..2ac460cf61 100644 --- a/src/com/android/settings/sound/MediaOutputPreferenceController.java +++ b/src/com/android/settings/sound/MediaOutputPreferenceController.java @@ -106,12 +106,9 @@ public class MediaOutputPreferenceController extends AudioSwitchPreferenceContro if (hapProfile != null && a2dpProfile != null && device == null) { hapProfile.setActiveDevice(null); a2dpProfile.setActiveDevice(null); - return; - } - if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { + } else if (hapProfile != null && hapProfile.getHiSyncId(device) != HI_SYNC_ID_INVALID) { hapProfile.setActiveDevice(device); - } - if (a2dpProfile != null) { + } else if (a2dpProfile != null) { a2dpProfile.setActiveDevice(device); } } |