summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/sound
diff options
context:
space:
mode:
authorjackqdyulei <jackqdyulei@google.com>2018-09-18 15:07:49 -0700
committerjackqdyulei <jackqdyulei@google.com>2018-09-18 15:19:32 -0700
commit1bf730093c5460d3d93749bc151e9d3199edea48 (patch)
treecb906d894516d6d8b49e0cadb0f09c324e057170 /src/com/android/settings/sound
parente5791f3c99f23810310484e2adff14cd12d6e718 (diff)
downloadpackages_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.java7
-rw-r--r--src/com/android/settings/sound/MediaOutputPreferenceController.java7
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);
}
}