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

Commit dca542e6 authored by Chaitanya Cheemala's avatar Chaitanya Cheemala Committed by Android (Google) Code Review
Browse files

Revert "Use constants when Bt flag is not enabled"

This reverts commit 6dc967b4.

Reason for revert: Likely culprit for b/342044448  - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Iaf9540ac9f139ede43f22752e67046847416f507
parent 6dc967b4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -76,7 +76,6 @@ aconfig_declarations_group {
        "android.widget.flags-aconfig-java",
        "backstage_power_flags_lib",
        "backup_flags_lib",
        "bluetooth_exported_flags_java_lib",
        "camera_platform_flags_core_java_lib",
        "com.android.hardware.input-aconfig-java",
        "com.android.input.flags-aconfig-java",
+15 −40
Original line number Diff line number Diff line
@@ -1198,8 +1198,6 @@ public class BtHelper {
            return AUDIO_DEVICE_CATEGORY_UNKNOWN;
        }
        String deviceCategory = new String(deviceType);

        if (com.android.bluetooth.flags.Flags.supportMetadataDeviceTypesApis()) {
        switch (deviceCategory) {
            case DEVICE_TYPE_HEARING_AID:
                return AUDIO_DEVICE_CATEGORY_HEARING_AID;
@@ -1213,31 +1211,8 @@ public class BtHelper {
            case DEVICE_TYPE_WATCH:
                return AUDIO_DEVICE_CATEGORY_WATCH;
            case DEVICE_TYPE_DEFAULT:
                    // fall through
            default:
                    break;
            }
        } else {
            // Duplicate switch for now to cover the cases when the flag is not rolled out
            // This will cover the cases in which clients could write directly to these
            // metadata keys
            switch (deviceCategory) {
                case "HearingAid":
                    return AUDIO_DEVICE_CATEGORY_HEARING_AID;
                case "Carkit":
                    return AUDIO_DEVICE_CATEGORY_CARKIT;
                case "Headset":
                case DEVICE_TYPE_UNTETHERED_HEADSET:
                    return AUDIO_DEVICE_CATEGORY_HEADPHONES;
                case "Speaker":
                    return AUDIO_DEVICE_CATEGORY_SPEAKER;
                case "Watch":
                    return AUDIO_DEVICE_CATEGORY_WATCH;
                case "Default":
                // fall through
                default:
                    break;
            }
        }

        BluetoothClass deviceClass = device.getBluetoothClass();