Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d5d5169 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "Refactor the SADeviceState to AdiDeviceState" into udc-dev-plus-aosp

parents ed123d59 7ac46d63
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -701,6 +701,7 @@ public class SettingsBackupTest {
                 Settings.Secure.ASSIST_SCREENSHOT_ENABLED,
                 Settings.Secure.ASSIST_STRUCTURE_ENABLED,
                 Settings.Secure.ATTENTIVE_TIMEOUT,
                 Settings.Secure.AUDIO_DEVICE_INVENTORY, // setting not controllable by user
                 Settings.Secure.AUTOFILL_FEATURE_FIELD_CLASSIFICATION,
                 Settings.Secure.AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT,
                 Settings.Secure.AUTOFILL_USER_DATA_MAX_FIELD_CLASSIFICATION_IDS_SIZE,
+4 −1
Original line number Diff line number Diff line
@@ -90,8 +90,10 @@ public class AudioDeviceInventory {
    private static final String mMetricsId = "audio.device.";

    private final Object mDeviceInventoryLock = new Object();
    @GuardedBy("mDeviceCatalogLock")
    @GuardedBy("mDeviceInventoryLock")
    private final ArrayList<AdiDeviceState> mDeviceInventory = new ArrayList<>(0);


    List<AdiDeviceState> getImmutableDeviceInventory() {
        synchronized (mDeviceInventoryLock) {
            return List.copyOf(mDeviceInventory);
@@ -107,6 +109,7 @@ public class AudioDeviceInventory {
    AdiDeviceState findDeviceStateForAudioDeviceAttributes(AudioDeviceAttributes ada,
            int canonicalDeviceType) {
        final boolean isWireless = isBluetoothDevice(ada.getInternalType());

        synchronized (mDeviceInventoryLock) {
            for (AdiDeviceState deviceSetting : mDeviceInventory) {
                if (deviceSetting.getDeviceType() == canonicalDeviceType