`modem->voice_mode` is a __ARegistrationUnsolMode__-typed variable, not __ARegistrationState__.  Please move the definition of ARegistrationUnsolMode from telephony/android_modem.c to telephony/android_modem.h and return correct type here.  Besides, function name `amodem_get_voice_unsol_mode` is more preferable for me because there is also a data member called `data_mode` in __AModemRec__ structure.