Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android READ_PHONE_STATE runtime permission asks to make and manage phone calls

In app I want to get unique phone id via TelephonyManager.getDeviceId(). To use this I need this permission READ_PHONE_STATE. Problem is with runtime permission on Android 6. In runtime permission popup dialogue, it asks to grant permission "To make and manage phone calls" which can scary users from using app. What can be done? Or can I get any other unique identifier for device without using such big permission?

TelephonyManager TM = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

String deviceId = TM.getDeviceId();
like image 405
Rafael Avatar asked Mar 10 '16 05:03

Rafael


People also ask

Why does an app need permission to make and manage phone calls?

Some apps require access to calls to provide you the best possible service by having full access to call data. Be aware that most of these apps will keep your data safe.

Which permission is required for phone call in Android?

It's the “dangerous” permissions that Android requires your permission to use. These “dangerous” permissions include access to your calling history, private messages, location, camera, microphone, and more.

What does READ_PHONE_STATE permission do?

READ_PHONE_STATE is one of the Android permissions categorized as dangerous. This is because it “allows read only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any Phone Accounts registered on the device” [2] .

What does Android permission Query_all_packages mean?

Use of the broad package (App) visibility (QUERY_ALL_PACKAGES) permission. Google Play restricts the use of high-risk or sensitive permissions, including the QUERY_ALL_PACKAGES permission, which gives visibility into the inventory of installed apps on a given device.


1 Answers

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();
like image 122
Developine Avatar answered Oct 11 '22 00:10

Developine