Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

security - How to grant system permission

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.

I am using some hidden apis

How can i grant this permission

Thanks in Advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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"?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...