Hi all,
I want to customize a permission for a service in Framework. The service is
also customized by me, the implement's mechanism is IPC (aidl) and boots
with the device. And it checks permissions before apps call the service's
method. But the result of checking permissions is always failure:denied.
I define the permission in framework/base/core/res/Manifest.xml:
<permission android:name="com.android.permission.SIMCARD_AUTHENTICATION"
android:protectionLevel="dangerous" />
Service code:
private boolean checkPermissions() {
Log.d(TAG,"checkPermissions"+mContext.checkCallingOrSelfPermission(android.Manifest.permission.SIMCARD_AUTHENTICATION));
Log.d(TAG,"Binder.getCallingPid()="+Binder.getCallingPid()+"Binder.getCallingUid()="+Binder.getCallingUid());
if
(mContext.checkCallingOrSelfPermission(android.Manifest.permission.SIMCARD_AUTHENTICATION)
!= PackageManager.PERMISSION_GRANTED){
return false;
}
return true;
}
Note: the log info is always -1(denied) and the other is normal.
The manifest.xml of APPs:
<application>
<activity android:name="DefaultActivity" android:label="@string/unknown">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<use-permissions android:name
="com.android.permission.SIMCARD_AUTHENTICATION"></use-permissions>
Who can help me ? Thanks!
--
-------------------------------------------------------------------------
Best Regards
Hongyue Xu
--
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