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

Commit 75f89f95 authored by Poomarin Phloyphisut's avatar Poomarin Phloyphisut
Browse files

[Audio Metric] Add BLE, Dock and HDMI device support for AudioPowerUsageDataReported atom.

Bug: 313666692
Test: Local Test
Change-Id: If2ba507fc950cda7081747e87afcd2076fbb7855
parent 328d19bf
Loading
Loading
Loading
Loading
+18 −9
Original line number Diff line number Diff line
@@ -99,12 +99,21 @@ bool AudioPowerUsage::deviceFromString(const std::string& device_string, int32_t
        { "AUDIO_DEVICE_OUT_WIRED_HEADSET",             OUTPUT_WIRED_HEADSET },
        { "AUDIO_DEVICE_OUT_WIRED_HEADPHONE",           OUTPUT_WIRED_HEADSET },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_SCO",             OUTPUT_BLUETOOTH_SCO },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET",     OUTPUT_BLUETOOTH_SCO },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_A2DP",            OUTPUT_BLUETOOTH_A2DP },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES", OUTPUT_BLUETOOTH_A2DP },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER",    OUTPUT_BLUETOOTH_A2DP },
        { "AUDIO_DEVICE_OUT_BLE_HEADSET",               OUTPUT_BLUETOOTH_BLE },
        { "AUDIO_DEVICE_OUT_BLE_SPEAKER",               OUTPUT_BLUETOOTH_BLE },
        { "AUDIO_DEVICE_OUT_BLE_BROADCAST",             OUTPUT_BLUETOOTH_BLE },
        { "AUDIO_DEVICE_OUT_USB_HEADSET",               OUTPUT_USB_HEADSET },
        { "AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET", OUTPUT_BLUETOOTH_SCO },
        { "AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET",         OUTPUT_DOCK },
        { "AUDIO_DEVICE_OUT_HDMI",                      OUTPUT_HDMI },

        { "AUDIO_DEVICE_IN_BUILTIN_MIC",           INPUT_BUILTIN_MIC },
        { "AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET", INPUT_BLUETOOTH_SCO },
        { "AUDIO_DEVICE_IN_BLUETOOTH_BLE",         INPUT_BLUETOOTH_BLE },
        { "AUDIO_DEVICE_IN_BLE_HEADSET",           INPUT_BLUETOOTH_BLE },
        { "AUDIO_DEVICE_IN_WIRED_HEADSET",         INPUT_WIRED_HEADSET_MIC },
        { "AUDIO_DEVICE_IN_USB_DEVICE",            INPUT_USB_HEADSET_MIC },
        { "AUDIO_DEVICE_IN_BACK_MIC",              INPUT_BUILTIN_BACK_MIC },
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@ public:
        OUTPUT_BLUETOOTH_SCO    = 0x10,
        OUTPUT_BLUETOOTH_A2DP   = 0x20,
        OUTPUT_SPEAKER_SAFE     = 0x40,
        OUTPUT_BLUETOOTH_BLE    = 0x80,
        OUTPUT_DOCK             = 0x100,
        OUTPUT_HDMI             = 0x200,

        INPUT_DEVICE_BIT        = 0x40000000,
        INPUT_BUILTIN_MIC       = INPUT_DEVICE_BIT | 0x1, // non-negative positive int32.
@@ -78,6 +81,7 @@ public:
        INPUT_WIRED_HEADSET_MIC = INPUT_DEVICE_BIT | 0x4,
        INPUT_USB_HEADSET_MIC   = INPUT_DEVICE_BIT | 0x8,
        INPUT_BLUETOOTH_SCO     = INPUT_DEVICE_BIT | 0x10,
        INPUT_BLUETOOTH_BLE     = INPUT_DEVICE_BIT | 0x20,
    };

    static bool typeFromString(const std::string& type_string, int32_t& type);