How to grant MODIFY_PHONE_STATE permission for apps ran on Gingerbread

The problem you’re having was introduced in Android 2.3 (Gingerbread). Any code you have that requires MODIFY_PHONE_STATE will work all the way up to (and including) Android 2.2, but will break for Android 2.3+.

A change was checked in by David Brown that limits the use of the MODIFY_PHONE_STATE permission to system apps. System apps are either

  1. Pre-installed into a system folder on the ROM
  2. Compiled by a manufacturer using their security certificate

I suspect you’re trying to use a hidden API like ITelephony. I was – and I got burned by this change. The Android team’s justification is that it was a hidden API that you shouldn’t have been using it in the first place.

That said, there was an enhancement request opened to create a proper public Telephony API, but Google killed the ticket. It appears their stance is that they do not intend to reverse direction and these APIs are not for public consumption.

Leave a Comment