Audio deamon: Add support of audio device events
Audio daemon will catch the events regarding the audio device changes and
transfer them to audio HAL.
Change-Id: Ida6b26142ece472a6e127904a43890ee44632d75
diff --git a/audiod/AudioDaemon.h b/audiod/AudioDaemon.h
index 23d78dd..3359d72 100644
--- a/audiod/AudioDaemon.h
+++ b/audiod/AudioDaemon.h
@@ -52,6 +52,10 @@
CPE_STATE
};
+enum audio_event_status {audio_event_on, audio_event_off};
+
+#define AUDIO_PARAMETER_KEY_EXT_AUDIO_DEVICE "ext_audio_device"
+
class AudioDaemon:public Thread, public IBinder :: DeathRecipient
{
/*Overrides*/
@@ -64,9 +68,13 @@
void notifyAudioSystem(int snd_card,
notify_status status,
notify_status_type type);
+ void notifyAudioSystemEventStatus(const char* event, audio_event_status status);
int mUeventSock;
bool getStateFDs(std::vector<std::pair<int,int> > &sndcardFdPair);
void putStateFDs(std::vector<std::pair<int,int> > &sndcardFdPair);
+ bool getDeviceEventFDs();
+ void putDeviceEventFDs();
+ void checkEventState(int fd, int index);
public:
AudioDaemon();
@@ -74,6 +82,11 @@
private:
std::vector<std::pair<int,int> > mSndCardFd;
+
+ //file descriptors for audio device events and their statuses
+ std::vector<std::pair<String8, int> > mAudioEvents;
+ std::vector<std::pair<String8, int> > mAudioEventsStatus;
+
};
}