Skip to content Skip to sidebar Skip to footer

Android Permissions: Phone Calls: Read Phone State And Identity

My android app has nothing to do with phone calls, but I'm seeing that when I install a debug build on my test device it requires 'Phone Calls: read phone state and identity' permi

Solution 1:

(Answering my own question in case anyone else runs into this problem and searches for it.)

Digging around in PackageParser.java in the android source, I found out that the system will automatically assign

android.permission.WRITE_EXTERNAL_STORAGE and 
android.permission.READ_PHONE_STATE

to any app that declares a targetSdk version of less than 4 (donut). There must be a compatibility reason for this, maybe apps targeting older versions could assume they had these permissions without declaring them explicitly. So, if you don't want these permissions added to your app implicitly, add a section like the following in AndroidManifest.xml

<uses-sdkandroid:minSdkVersion="4"android:targetSdkVersion="4" />

That is all.

Have fun, -Mike

Solution 2:

Android 1.6 changelog: http://developer.android.com/sdk/android-1.6.html#api

WRITE_EXTERNAL_STORAGE: Allows an application to write to external storage. Applications using API Level 3 and lower will be implicitly granted this permission (and this will be visible to the user); Applications using API Level 4 or higher must explicitly request this permission.

But that is only one of them. For some reason the official change log is missing the info about READ_PHONE_STATE. The full story is cleared up here: http://blogs.zdnet.com/Burnette/?p=1369&page=3

New permissions. 1.6 programs must explicitly request the WRITE_EXTERNAL_STORAGE permission to be able to modify the contents of the SD card, and they must explicitly request the READ_PHONE_STATE permission to be able to be able to retrieve phone state info. Apps targeting earlier versions will always request these permissions implicitly.

So as you can see, there is no way to publish an app targeted at 1.5 or earlier without requesting those permissions when installed on phones running 1.6 or higher.

Post a Comment for "Android Permissions: Phone Calls: Read Phone State And Identity"