diff options
| author | 2024-04-19 19:58:51 -0700 | |
|---|---|---|
| committer | 2024-04-19 20:04:08 -0700 | |
| commit | 45a719a3a208179d31b01a3145cc7c2a44df433a (patch) | |
| tree | 388a3d41905788b209dbd7d90adb1059e2096f5e | |
| parent | 90805383a0797581c1dc1988ea54fb3d2988a8c4 (diff) | |
Avoid dependency to flagged constants in BtHelper
A cleaner way would be to include the aconfig flag library from
BluetoothDevice. This is a more complicated approach since this would
require an apex platform dependency which is not easy (maybe even
possible) to get for VIC anymore.
This is why a simple workaround to use the same constant values in
BtHelper should work until the flag is rolled out completely.
Test: manual device type change
Bug: 335936458
Change-Id: I6880f5522607a3995b4b3aaa0d398b9a3255812a
| -rw-r--r-- | services/core/java/com/android/server/audio/BtHelper.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java index a649d34884a7..3a3ff6472fde 100644 --- a/services/core/java/com/android/server/audio/BtHelper.java +++ b/services/core/java/com/android/server/audio/BtHelper.java @@ -15,11 +15,7 @@ */ package com.android.server.audio; -import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_CARKIT; import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_DEFAULT; -import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_HEADSET; -import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_HEARING_AID; -import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_SPEAKER; import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_UNTETHERED_HEADSET; import static android.bluetooth.BluetoothDevice.DEVICE_TYPE_WATCH; import static android.media.AudioManager.AUDIO_DEVICE_CATEGORY_CARKIT; @@ -149,6 +145,14 @@ public class BtHelper { private static final int BT_LE_AUDIO_MIN_VOL = 0; private static final int BT_LE_AUDIO_MAX_VOL = 255; + // BtDevice constants currently rolling out under flag protection. Use own + // constants instead to avoid mainline dependency from flag library import + // TODO(b/335936458): remove once the BtDevice flag is rolled out + private static final String DEVICE_TYPE_SPEAKER = "Speaker"; + private static final String DEVICE_TYPE_HEADSET = "Headset"; + private static final String DEVICE_TYPE_CARKIT = "Carkit"; + private static final String DEVICE_TYPE_HEARING_AID = "HearingAid"; + /** * Returns a string representation of the scoAudioMode. */ |