Exported service does not require permission警告
来源:互联网 发布:java 跨包无法import 编辑:程序博客网 时间:2024/05/17 18:16
很久没写过应用了,今天写一个Service时,在manifest文件的<service>标签发现了这个警告
<service android:name="SendService"> <intent-filter> <action android:name="com.oem.OEMSendService.SENDMAIL" /> </intent-filter> </service>
查了下api,终于发现一些端倪
原因:这是一个可以被外部访问的service,需要使用权限来限制外部访问
解决方法:
1.添加
android:exported="false
"
这种方法是限制外部访问,自然不需要权限了
2.声明权限
先在<manifest>标签下加入
<permission android:protectionLevel="normal" android:name="oem.permission.SENDMAIL"></permission>
然后在<service>标签下
android:permission="oem.permission.SENDMAIL"
- 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警告
- Android Exported service does not require permission警告
- Exported service does not require permission
- Proxy和InvocationHandler模拟Aop底层实现
- 开发了一个chrome插件
- 20个非常有用的PHP类库
- 6-29解析文件
- J2EE泛型中的协变与逆变
- Exported service does not require permission警告
- Assembly(c#中简单说明)
- mysql自带工具使用介绍
- 捷豹路虎风靡中国汽车市场
- 文本框默认提示灰色,点击后输入黑色
- 两级联动菜单实例
- VS2008快捷键大全
- Hive Invalid maximum heap size: -Xmx4096m错误解决
- iphone(object-c) 内存管理(2) 内存管理策略