xported service does not require permission问题。
来源:互联网 发布:网络共享打印机不打印 编辑:程序博客网 时间:2024/06/06 00:11
The default value depends on whether the service contains intent filters.
就是说默认值取决于该service是否包含intent过滤器filter。如果没有<intent-filter>,那只能通过指定其准确的类名访问。这意味着该service打算只在该应用内部使用(因为其他应用可能根本不知道这个类的名字)。在这种情况下,默认值是“false”,另一方面,当存在至少一个filter时,就表明该service打算供外部来使用,因此默认值是“true”。
其实还有一种解决的办法。那就是我们在这里自己定义一个权限。既然外部的其他service不需权限就能访问我们的service,那么我们自己定义权限,然后在需要调用该service的应用的配置文件里面声明调用该service的所需要的权限不就可以了吗?代码更改为:
1 <service android:name=".AidlService"2 android:permission="com.exmaple.myaidldemo.myaidlservice">3 <intent-filter >4 <action android:name="com.example.myaidldemo.action.AIDL_SERVICE"/>5 </intent-filter>6 </service>
然后在我们需要调用该service的其他应用的配置文件中加入下面这行代码:
<uses-permission android:name="com.exmaple.myaidldemo.myaidlservice"/>
阅读全文
0 0
- xported service does not require permission问题。
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission警告
- Exported service does not require permission解决办法
- OpenCV学习日记4
- 金、古归来不看梁
- 如果有两位小数不为0则保留两位小数,如果有一位小数不为0则保留一位小数,否则保留整数
- Android 5.0+删除Sdcard文件
- 欢迎使用CSDN-markdown编辑器
- xported service does not require permission问题。
- 【linux-WebServer】nginx学习3(nginx基础概念-connection)
- 安卓使用okhttp连接网络
- [曝光台]各个机器学习群群主请注意,有这么一些家伙,专业打广告,别让他们进群
- 端午佳节,几维安全多款加密产品感恩大回馈!
- Dart与消息循环机制
- 网络编程 TCP分包粘包MTU和MSS之间的关系分析
- 关键字高亮显示
- MVC5+EF6 入门完整教程六