Reputation: 1839
I used to have call persmissions in my app manifest but I recently removed them all. I changed my ACTION_CALL intents for ACTION_DIAL which isn't supposed to ask for any permission. The thing is that the app is still asking for those permissions... So, why could be this happening?
Thanks in advance
EDIT: I've added some code:
Basically this is my AndroidManifest.xml
structure:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.app" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity>
(...)
</activity>
<receiver >
(...)
</receiver>
<activity >
(...)
</activity>
<activity>
(...)
</activity>
</application>
</manifest>
And the source code I've changed in order to avoid using any permission:
_call.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (_phone.getText().length() != 0) {
String uri = "tel:" + _phone.getText();
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(uri));
startActivity(intent);
}
}
});
I don't know what logcat would be useful for, cause the "error" is that the app ask for the permission when I'm going to install it, not when it is running
Upvotes: 1
Views: 1468
Reputation: 7603
Please try one of those solutions:
Check all the permission of manifests (of your app and library folder). Some library may require additional permissions. In Android Studio, you should browse the manifests in Project mode (not Packages/Android view mode of left side panel): project_name/src/main/manifest.xml
.
If all the manifests are clear, add use-feature
with android:required="false"
to your manifest of main project. This will tell GP that your app can be installed on devices without telephony, such as tablet.
Like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.app" >
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity>
(...)
</activity>
<receiver >
(...)
</receiver>
...
</application>
Upvotes: 0
Reputation: 3520
You need to add this in AndroidManifest.xml
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-feature android:name="android.hardware.telephony" android:required="false" />
and use Intent.ACTION_DIAL like you did
here is official doc on permission
Upvotes: 1