权限只授予系统的应用程序,在清单 [英] Permission is only granted to system app, in Manifest

查看:216
本文介绍了权限只授予系统的应用程序,在清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想这个权限添加到我的Andr​​oid清单:

 <使用-权限的Andr​​oid:名称=android.permission.MODIFY_PHONE_STATE/>
 

但经过i贴在我的清单此权限,它测试的红色下划线,并说:

  

权限只授予给系统应用

我该怎么办?

解决方案

MODIFY_PHONE_STATE 权限授予系统只应用程序。

有关您的信息,有两种类型的Andr​​oid应用程序的方式:系统和放大器;用户

  

用户应用是通过谷歌只是所有的正常的应用程序安装Play商店,亚马逊的Appstore或侧载。这些进入你的Andr​​oid手机,这是内部存储器的用户数据和应用程序所提供的部分/数据分区。

     

系统应用基本上是来了pre-安装了您的ROM中的应用程序。在一个标准的Andr​​oid用户环境中,用户没有写访问/系统分区,因此,在安装或卸载系统应用服务,直接是不可能的。

     

在为你的Andr​​oid设备上安装的应用程序作为系统应用程序,    您的设备必须要么是植根或安装自定义恢复(或两者)

话虽这么说,是因为你有一个有效的code和汇编应该工作的错误其实是错误的。它会更好,如果它给了一个警告。在Eclipse中,你可以很容易地解决它。只要到:

  

窗口 - > preferences - > Android的 - >皮棉错误检查

查找 ProtectedPermission 从列表中设置严重性的东西比其他错误(信息为例)。这样,你的项目将仍然编译。

I want to add this permission to my Android manifest:

<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />

But after I paste this permission in my manifest, it tests red underline and says:

permission is only granted to system apps

What can I do?

解决方案

MODIFY_PHONE_STATE permission is granted to system apps only.

For your information, there are 2 types of Android apps: system & user

User apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.

System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible.

In order to install an app as a system app on your Android device, your device must either be rooted or have a custom recovery installed (or both).

That being said, that error is actually wrong because you have a valid code and compilation should work. It would be better if it gave a warning instead. In Eclipse you can easily fix it. Just go to:

Window -> Preferences -> Android -> Lint Error Checking.

Find ProtectedPermission from the list and set the severity to something other than error(info for example). This way your project will still compile.

这篇关于权限只授予系统的应用程序,在清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆