Index: chromeos/audio/audio_devices_pref_handler.h |
diff --git a/chromeos/audio/audio_devices_pref_handler.h b/chromeos/audio/audio_devices_pref_handler.h |
index 2347aad6a467c1e7956d7ec9537e8bf186b9d12f..7b8d7cc7969676991d6ab8319b0f71a5286f7340 100644 |
--- a/chromeos/audio/audio_devices_pref_handler.h |
+++ b/chromeos/audio/audio_devices_pref_handler.h |
@@ -15,6 +15,20 @@ namespace chromeos { |
struct AudioDevice; |
+// Used to represent an audio device's state. This state should be updated |
+// to AUDIO_STATE_ACTIVE when it is selected as active or set to |
+// AUDIO_STATE_INACTIVE when selected to a different device. When the audio |
+// device is unplugged, its last active/inactive state should be stored. |
+// The default value of device state will be AUDIO_STATE_NOT_AVAILABLE if |
+// the device is not found in the pref settings. |
+// Note that these states enum can't be renumbered or it would break existing |
+// preference. |
+enum AudioDeviceState { |
+ AUDIO_STATE_ACTIVE = 0, |
+ AUDIO_STATE_INACTIVE = 1, |
+ AUDIO_STATE_NOT_AVAILABLE = 2, |
+}; |
+ |
// Interface that handles audio preference related work, reads and writes |
// audio preferences, and notifies AudioPrefObserver for audio preference |
// changes. |
@@ -38,6 +52,10 @@ class CHROMEOS_EXPORT AudioDevicesPrefHandler |
// Sets the audio mute value to prefs for a device. |
virtual void SetMuteValue(const AudioDevice& device, bool mute_on) = 0; |
+ virtual AudioDeviceState GetDeviceState(const AudioDevice& device) = 0; |
+ virtual void SetDeviceState(const AudioDevice& device, |
+ AudioDeviceState state) = 0; |
+ |
// Reads the audio output allowed value from prefs. |
virtual bool GetAudioOutputAllowedValue() = 0; |