29

I have seen some Android apps on my phone require this android.permission.READ_PHONE_STATE permission. I don't know if I could trust them. I know this permission will give the app access to many information. I'm particularly interested in what functionality in an Android app normally require the information like DeviceId , SimSerialNumber, SubscriberId?

Wei Yang
  • 895
  • 3
  • 15
  • 26

3 Answers3

23

Phone state provides access to a lot of information about the phone. Usual usages will be for reading the IMEI of your phone and your phone number. This can be useful to identify you in their systems.

It can also be needed if the application is made compatible for Android 1.5 or lower, because this permission didn't exist back then and is added automatically by the play store to those apps

See also: https://android.stackexchange.com/questions/605/why-do-so-many-applications-require-permission-to-read-the-phone-state-and-ident

Community
  • 1
  • 1
Samuel Bolduc
  • 18,163
  • 7
  • 34
  • 55
21

Another possible reason is so they can mute audio events if you're in the middle of a call. This is why apps like Pandora, Spotify, etc need the permission - so they can mute themselves when you get a call.

Carl Anderson
  • 3,446
  • 1
  • 25
  • 45
  • Exactly. The problem is the Android permission is too coarse - an app only needs to know *that* a call is in progress in order to mute itself, not what number is connected, or the user's phone's IMEI. There is an [Android issue to split this permission](https://code.google.com/p/android/issues/detail?id=21504) and there's a much better way of muting audio when a call comes, which doesn't require any permission - [onAudioFocusChange](http://developer.android.com/reference/android/media/AudioManager.OnAudioFocusChangeListener.html). – Dan Dascalescu Jan 07 '16 at 00:41
2

Not long ago I discovered that for some devices you should add android.permission.READ_PHONE_STATE if your application sends SMS. Probably in some cases SmsManager tries to retrieve some information about phone state before sending sms.

For example getting exception for HUAWEI GRA-L09:

java.lang.SecurityException: Requires READ_PHONE_STATE: Neither user 10174 nor current process has android.permission.READ_PHONE_STATE.
at android.os.Parcel.readException(Parcel.java:1543)
at android.os.Parcel.readException(Parcel.java:1496)
at com.android.internal.telephony.ISms$Stub$Proxy.s! endMultipartTextForSubscriber(ISms.java:1224)
at android.telephony.SmsManager.sendMultipartTextMessage(SmsManager.java:404)
MikeL
  • 5,385
  • 42
  • 41
  • 2
    I'm having the same issue, any insights on what to do here? I think it's a problem to ask this major permission only for some cases where you need it for sending SMS. – Tomer Petel Jul 05 '17 at 15:12
  • @TomerPetel did you find any solution for this issue actually i am working on a my clg project in which i am developing a sms app i am facing this issue & my app is crashing on oreo, and antivirus is not allowing to open in kitkat & sending sms – Arsh Kaushal Aug 02 '18 at 05:44
  • @ArshKaushal no I didn't find a solution. I just put it in a try/catch clause and try an alternate method if SMS doesn't work (i.e. other sharing intents). – Tomer Petel Aug 04 '18 at 10:36