Neither user 10102 nor current process has android.permission.READ_PHONE_STATE

I am trying to call getCallCapablePhoneAccounts() method of android.telecom.TelecomManager class. Though i have added required user-permission, i am getting Security exception.

Here is the line of code where i am getting exception

List<PhoneAccountHandle> list = getTelecomManager().getCallCapablePhoneAccounts();

user permission added in manifest

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Exception stacktrace Caused by: java.lang.SecurityException: getDefaultOutgoingPhoneAccount: Neither user 10102 nor current process has android.permission.READ_PHONE_STATE. at android.os.Parcel.readException( at android.os.Parcel.readException( at$Stub$Proxy.getDefaultOutgoingPhoneAccount( at android.telecom.TelecomManager.getDefaultOutgoingPhoneAccount(


On Android >=6.0, We have to request permission runtime.

Step1: add in AndroidManifest.xml file

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Step2: Request permission.

int permissionCheck = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE);

if (permissionCheck != PackageManager.PERMISSION_GRANTED) {
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_PHONE_STATE}, REQUEST_READ_PHONE_STATE);
} else {

Step3: Handle callback when you request permission.

public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
    switch (requestCode) {
            if ((grantResults.length > 0) && (grantResults[0] == PackageManager.PERMISSION_GRANTED)) {


Edit: Read official guide here Requesting Permissions at Run Time

Are you running Android M? If so, this is because it's not enough to declare permissions in the manifest. For some permissions, you have to explicitly ask user in the runtime:

I was experiencing this problem on Samsung devices (fine on others). like zyamys suggested in his/her comment, I added the manifest.permission line but in addition to rather than instead of the original line, so:

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.Manifest.permission.READ_PHONE_STATE" />

I'm targeting API 22, so don't need to explicitly ask for permissions.

Need Your Help

Delete data sqllite on iphone - database is locked

iphone objective-c database sqlite

my app crashed when I try to delete a data from my SqlLite db.