如何授予系统权限 [英] How to grant system permission

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

问题描述

我只是试图清除应用程序数据,却得到如下错误

I am just trying to clear the app data and getting below error

java.lang.SecurityException: Neither user 10028 nor current process has 
android.permission.CLEAR_APP_USER_DATA.

我使用的一些隐藏的API

I am using some hidden apis

我怎样授予此权限

在此先感谢。

推荐答案

您不会得到许可在一个正常的设备,除非你正在开发的系统应用程序。 参阅这篇文章。您可以添加到您的清单,添加此权限不会造成任何编译错误或警告。但是,这根本就不是在运行时的工作。

You will not get that permission in a normal device unless you are developing system app. Refer to this article. You can add that to your manifest, adding this permission will not cause any compile error or warning. But it will simply not work in run time.

顺便说一句,如果你真的需要清除应用程序的数据,你为什么不逐一明确的文件/ preferences你是从你的应用程序的数据的目的产生?

By the way, if you really need to clear the data of your application, why don't you one by one clear the files/preferences you are generating from your application for purpose of "data"?

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

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