How can I request for permission "android.permission.READ_PRIVILEGED_PHONE_STATE"? I know that starting from Android 10, third-party apps installed from the Google Play Store cannot declare privileged permissions.
https://developer.android.com/about/versions/10/privacy/changes#data-ids
However my app will not be distributet with Google Play Store. I will share the apk file and users will install aplication manually.
I have declared permission in manifest:
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
I'm also trying to request it as any regular permission:
if(ActivityCompat.checkSelfPermission(this.getApplicationContext(), "android.permission.READ_PRIVILEGED_PHONE_STATE") != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_PRIVILEGED_PHONE_STATE"},123);
}
But nothing is happening. I'm not being prompted to grant this permission. No alert dialog is being presented. How can I request for this permission?