gpt4 book ai didi

android - 权限仅授予系统应用程序,在 list 中

转载 作者:IT老高 更新时间:2023-10-28 22:11:47 33 4
gpt4 key购买 nike

我想将此权限添加到我的 Android list 中:

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

但是在我将此权限粘贴到 list 中后,它会测试红色下划线并显示:

permission is only granted to system apps

我能做什么?

最佳答案

MODIFY_PHONE_STATE权限仅授予系统应用。

供您引用,Android 应用有 2 种类型:系统和用户

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).

话虽如此,该错误实际上是错误的,因为您有有效的代码并且编译应该可以工作。如果它发出警告会更好。在 Eclipse 中,您可以轻松修复它。只需前往:

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

从列表中找到 ProtectedPermission 并将严重性设置为错误以外的其他内容(例如信息)。这样你的项目仍然可以编译。

关于android - 权限仅授予系统应用程序,在 list 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13597125/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com