Merge "Enable/Disable ASHA profile with LE audio toggle" into udc-qpr-dev am: b40e5c2228

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

Change-Id: I024ffb878311a911b6acd93c77f4136fed2e912b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Yuyang Huang
2023-08-03 23:05:35 +00:00
committed by Automerger Merge Worker

View File

@@ -324,11 +324,16 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
return;
}
LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile();
for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
Log.d(TAG,
"device:" + leAudioDevice.getDevice().getAnonymizedAddress()
+ "disable LE profile");
profile.setEnabled(leAudioDevice.getDevice(), false);
if (asha != null) {
asha.setEnabled(leAudioDevice.getDevice(), true);
}
}
if (!SystemProperties.getBoolean(ENABLE_DUAL_MODE_AUDIO, false)) {
@@ -354,12 +359,16 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
disableProfileBeforeUserEnablesLeAudio(mProfileManager.getA2dpProfile());
disableProfileBeforeUserEnablesLeAudio(mProfileManager.getHeadsetProfile());
}
LocalBluetoothProfile asha = mProfileManager.getHearingAidProfile();
for (CachedBluetoothDevice leAudioDevice : mProfileDeviceMap.get(profile.toString())) {
Log.d(TAG,
"device:" + leAudioDevice.getDevice().getAnonymizedAddress()
+ "enable LE profile");
profile.setEnabled(leAudioDevice.getDevice(), true);
if (asha != null) {
asha.setEnabled(leAudioDevice.getDevice(), false);
}
}
}
@@ -376,6 +385,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
+ profile.toString() + " profile is disabled. Do nothing.");
}
}
} else {
if (profile == null) {
Log.w(TAG, "profile is null");
} else {
Log.w(TAG, profile.toString() + " is not in " + mProfileDeviceMap);
}
}
}
@@ -392,6 +407,12 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
+ profile.toString() + " profile is enabled. Do nothing.");
}
}
} else {
if (profile == null) {
Log.w(TAG, "profile is null");
} else {
Log.w(TAG, profile.toString() + " is not in " + mProfileDeviceMap);
}
}
}