Android Remote Service 外部访问权限控制
2015-06-01 17:53
656 查看
<Service>可以通过以下参数限制外部访问android:exported="false" //不允许其他进程访问android:process=":remote" //声明service独立运行进程名称如果需要支持外部访问,但限定只有某些进程可以访问<permission android:name="com.example.REQUEST_FINGERPRINT" android:protectionLevel="signature" /> //声明一个自定义权限<service android:exported="true" //允许其他进程访问 android:process=":remote" //声明service独立运行进程名称 android:permission="com.example.REQUEST_FINGERPRINT" > //声明外部访问需要注册的权限然后在需要远程访问该Service的App中引用权限<uses-permission android:name="com.example.REQUEST_FINGERPRINT" />SDK API 21 中,如果声明了一个可外部访问的Service而没有声明所需权限,会在IDE中看到warning:Exported service does not require permission如果App访问了一个需要权限的Service,那么App会崩溃,并提示Error:Not allowed to bind to service Intent
相关文章推荐
- Android文本样式——下
- Android开发之Intent跳转到系统应用中的拨号界面、联系人界面、短信界面
- Android-自动化埋点
- base64图片格式的转换
- AndroidEventBus新特性:添加粘性事件、不需要手动注销事件总线
- android源码使用proguard混淆编译及错误总结
- 获取Android系统memory的使用情况的脚本
- 图片的模糊处理
- android折线趋势图
- android:gravity 和 android:layout_Gravity
- 直角图片进行圆角处理
- XMPP协议之Androidpn介绍
- android 语音对话demo
- Android SDK Manager 更新代理配置
- Android ViewFlow的一个例子
- 探索Android中的Parcel机制(上)
- Android-manifest详解
- Android-Activity任务栈
- Android-Activity状态保存
- android模拟器自动打开搜索的BUG