Hi,
I just wrote a instrumentation test case for the Contacts app,
my test app is just to make a phone call,
i used the ITelephony API,s to make a call ,
code :
private void doITelephonyCall() {
log("doITelephonyCall()...");
// Get a phone number from the EditText widget
String number = "6505551234";
try {
ITelephony phone =
ITelephony.Stub.asInterface(ServiceManager.checkService("phone"));
log("- phone: " + phone);
log("- calling call()...");
phone.call(number);
log(" Done.");
} catch (RemoteException ex) {
Log.w(LOG_TAG, "RemoteException!", ex);
}
}
while running the test app on mobile i am getting error as :
com.android.contacts.activities.DialtactsActivityTest:INSTRUMENTATION_RESULT:
shortMsg=java.lang.SecurityException
INSTRUMENTATION_RESULT: longMsg=java.lang.SecurityException: Neither
user 10002 nor current process has android.permission.CALL_PHONE.
INSTRUMENTATION_CODE: 0
even though i given all permissions
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" /
>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission
android:name="android.permission.CALL_PHONE.INSTRUMENTATION_CODE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" /
>
<uses-permission android:name="android.permission.READ_PHONE_STATE" /
>
<uses-permission
android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission
android:name="android.permission.PERFORM_CDMA_PROVISIONING" />
<uses-permission
android:name="android.permission.PERFORM_CDMA_PROVISIONING" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /
>
Can anybody pls help me how to solve this
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en