Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: chromeos/audio/cras_audio_handler.h

Issue 872303003: Do not re-select active device if a lower priority device is hotplugged in and user has already sel… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/audio/cras_audio_handler.h
diff --git a/chromeos/audio/cras_audio_handler.h b/chromeos/audio/cras_audio_handler.h
index e16161f0c27c83948a012c46c716c247deca1500..28a858b9fd7c568bc0d4730cc921fdaa6f643bf8 100644
--- a/chromeos/audio/cras_audio_handler.h
+++ b/chromeos/audio/cras_audio_handler.h
@@ -269,7 +269,10 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Returns true if there is any device change for for input or output,
// specified by |is_input|.
- bool HasDeviceChange(const AudioNodeList& new_nodes, bool is_input);
+ // The new discovered nodes are returned in |new_discovered|.
+ bool HasDeviceChange(const AudioNodeList& new_nodes,
+ bool is_input,
+ AudioNodeList* new_discovered);
// Handles dbus callback for GetNodes.
void HandleGetNodes(const chromeos::AudioNodeList& node_list, bool success);
@@ -290,9 +293,15 @@ class CHROMEOS_EXPORT CrasAudioHandler : public CrasAudioClient::Observer,
// Removes |node_id| from additional active nodes.
void RemoveActiveNodeInternal(uint64 node_id, bool notify);
- // Returns true if |device| is not found in audio_devices_, or it is found
- // but changed its |active| property.
- bool FoundNewOrChangedDevice(const AudioDevice& device);
+ enum DeviceStatus {
+ OLD_DEVICE,
+ NEW_DEVICE,
+ CHANGED_DEVICE,
+ };
+
+ // Checks if |device| is a newly discovered, changed, or existing device for
+ // the nodes sent from NodesChanged signal.
+ DeviceStatus CheckDeviceStatus(const AudioDevice& device);
void NotifyActiveNodeChanged(bool is_input);
« no previous file with comments | « no previous file | chromeos/audio/cras_audio_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698