diff options
author | Kim Uk <w0806.kim@samsung.com> | 2011-07-19 12:57:26 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-07-19 13:09:39 -0700 |
commit | c2a69f502944444c9b17f3c00c413091dbcc5c75 (patch) | |
tree | 41db41dc7a14ce69269ef5a6b11d0b6699cfe036 /audio/ril_interface.h | |
parent | 2006f1c32bbc3a55bc8c598ce8484c9b5673b011 (diff) | |
download | device_samsung_tuna-c2a69f502944444c9b17f3c00c413091dbcc5c75.zip device_samsung_tuna-c2a69f502944444c9b17f3c00c413091dbcc5c75.tar.gz device_samsung_tuna-c2a69f502944444c9b17f3c00c413091dbcc5c75.tar.bz2 |
audio: check for ril presence before calling into it
This prevents a seg fault if no ril is present.
Change-Id: I5f9443e31bdcab07df21d9f12ed2dd92807300f8
Diffstat (limited to 'audio/ril_interface.h')
-rw-r--r-- | audio/ril_interface.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/audio/ril_interface.h b/audio/ril_interface.h index 95da631..c47484d 100644 --- a/audio/ril_interface.h +++ b/audio/ril_interface.h @@ -28,6 +28,12 @@ #define RIL_CLIENT_ERR_RESOURCE 6 // Resource not available #define RIL_CLIENT_ERR_UNKNOWN 7 +struct ril_handle +{ + void *handle; + void *client; +}; + enum ril_sound_type { SOUND_TYPE_VOICE, SOUND_TYPE_SPEAKER, @@ -49,19 +55,12 @@ enum ril_clock_state { SOUND_CLOCK_START }; -/* Function pointers */ -void *(*ril_open_client)(void); -int (*ril_close_client)(void *); -int (*ril_connect)(void *); -int (*ril_is_connected)(void *); -int (*ril_disconnect)(void *); -int (*ril_set_call_volume)(void *, enum ril_sound_type, int); -int (*ril_set_call_audio_path)(void *, enum ril_audio_path); -int (*ril_set_call_clock_sync)(void *, enum ril_clock_state); - /* Function prototypes */ -int ril_open(void **ril_handle, void **ril_client); -int ril_close(void *ril_handle, void *ril_client); - +int ril_open(struct ril_handle *ril); +int ril_close(struct ril_handle *ril); +int ril_set_call_volume(struct ril_handle *ril, enum ril_sound_type sound_type, + int volume); +int ril_set_call_audio_path(struct ril_handle *ril, enum ril_audio_path path); +int ril_set_call_clock_sync(struct ril_handle *ril, enum ril_clock_state state); #endif |