Zedday
Zedday

Reputation: 17

android using GSMPhone to communicate with rild

I'm working on a non phone device that run Android 2.3.3. We have a custom Android version (with some additionnal driver) and my application has "system" privileges since we build our apps with the same key used to build android.

I had unlocked full Android API (including com.android.internal.*) following this post : https://devmaze.wordpress.com/2011/01/18/using-com-android-internal-part-1-introduction/.

I deleted the Phone.apk from the device to ensure that no process is using rild.

I can instanciate a GSMPhone from my app, but after, I'm unable to execute any commands like supplyPin or getImei. I always have the same error : 

CommandException: RADIO_NOT_AVAILABLE.

I'm really stuck here, any help would be precious.

Upvotes: 0

Views: 984

Answers (2)

zq w
zq w

Reputation: 36

  1. adb shell ps | grep rild to check if RILD is in runing.
  2. Since you can access all the api, do some initialization like PhoneApp do in Phone application OnCreate(mostly like setting params to modem, set radio power which will power on/off the modem, etc)

Upvotes: 0

Bilal Qamar
Bilal Qamar

Reputation: 342

CommandException: RADIO_NOT_AVAILABLE indicates that the rild socket is not opened. In other words, the rild service is not attached to the underlying basebane/modem you are using.

Run ps in adb shell to check if rild service is in the list. If it is in the list, run ls -l /dev/tty* and check if the modem device attached with the Android platform exists here or not. If it does not exist, it means that the Kernel is unable to enumerate your modem device and you need to add support in kernel for it. If it exists, run adb logcat -b radio and check the radio logs output which would really be helpful to diagnose the issue further.

Upvotes: 0

Related Questions