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 7b8d7cc7969676991d6ab8319b0f71a5286f7340..deba1e6487145f261404949c44d083367e0c8f0b 100644 |
--- a/chromeos/audio/audio_devices_pref_handler.h |
+++ b/chromeos/audio/audio_devices_pref_handler.h |
@@ -15,20 +15,6 @@ 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. |
@@ -52,9 +38,19 @@ 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; |
+ // Sets the device active state in prefs. |
+ // Note: |activate_by_user| indicates whether |device| is set to active |
+ // by user or by priority, and it only matters when |active| is true. |
+ virtual void SetDeviceActive(const AudioDevice& device, |
+ bool active, |
+ bool activate_by_user) = 0; |
+ // Returns false if it fails to get device active state from prefs. |
+ // Otherwise, returns true, pass the active state data in |*active| |
+ // and |*activate_by_user|. |
+ // Note: |*activate_by_user| only matters when |*active| is true. |
+ virtual bool GetDeviceActive(const AudioDevice& device, |
+ bool* active, |
+ bool* activate_by_user) = 0; |
// Reads the audio output allowed value from prefs. |
virtual bool GetAudioOutputAllowedValue() = 0; |