Android permissions: Phone Calls: read phone state and identity
(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-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
That is all.
Have fun, -Mike
Android READ_PHONE_STATE runtime permission asks to make and manage phone calls
I am using this as a unique device identifier in my app and i don't need any run time permission.
String android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
or You can use this
String uuid = UUID.randomUUID().toString();
How to avoid READ_PHONE_STATE Android permission
You don't need the device identifier for push, you just need the push key in which case getDeviceId()
or similar calls are never made. If you follow the push tutorial there won't be any permission for phone state within your app.
which one of these permissions in manifest says I'm reading phone call information?
It turned out to be an issue with a bug where you need to at least specify a minimum SDK of 4:
Android permissions: Phone Calls: read phone state and identity
Android READ PHONE STATE permission
ActivityCompat.requestPermissions()
is asynchronous. It returns control to you immediately. You do not yet have the permission.
Move all that stuff that appears after the ActivityCompat.requestPermissions()
call into a separate method (which I will call here foo()
). Then:
If
checkSelfPermission()
shows that you have the permission, callfoo()
If
checkSelfPermission()
shows that you do not have the permission, in youronRequestPermissionsResult()
method, if you now have the permission, callfoo()
If in
onRequestPermissionsResult()
, you still do not have the permission (e.g., the user denied your request), deal with it somehow
Android READ PHONE STATE?
I did not see <uses-permission android:name="android.permission.READ_PHONE_STATE" />
in your Manifest file.
It is required for your application to be able to read that state.
Related Topics
Android: How Do Bluetooth Uuids Work
Listselector Applies to the Entire List
How to Give Hexagon Shape to Imageview
Android Edittext Onchange Listener
Viewpager Detect When User Is Trying to Swipe Out of Bounds
How to Set the Language in Speech Recognition on Android
What Causes Android's Contentresolver.Query() to Return Null
Android: Get Height of a View Before It's Drawn
Hiding Title in a Fullscreen Mode
Extract Code Country from Phone Number [Libphonenumber]
Convert Bitmap Array to Yuv (Ycbcr Nv21)
How to Repeat a Method Every 10 Minutes After a Button Press and End It on Another Button Press
How to Wrap the Height of a Viewpager to the Height of Its Current Fragment
How to Pair Bluetooth Device Programmatically Android
Seek Bar, Change Path Color from Yellow to White
How to Change Bitmap Image Color in Android
How to Open Standard Google Map Application from My Application