Questions regarding modifying the OS belong on: http://source.android.com
On Tue, Jun 7, 2011 at 2:35 AM, xhy <[email protected]> wrote: > 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 -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 3.4 Available! -- 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

