Android permissions: Phone Calls: read phone state and identity

前端 未结 2 690
礼貌的吻别
礼貌的吻别 2020-11-27 11:32

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 identi

2条回答
  •  感情败类
    2020-11-27 12:23

    (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

    
    

    That is all.

    Have fun, -Mike

提交回复
热议问题