Permission Denial: this requires android.permission.INTERACT_ACROSS_USERS_FULL
Asked Answered
Q

5

36

I am having an issue with sqlite db in Android. But as I made a quick research on the internet, I suspect that the problem is not related to sqlite but system user. My app is not recognized as authorized user to access db functionalities. I tried to apply possible suggested solutions in stack overflow but none of them made a difference. This is the LogCat I am facing every time I attempt to use db functionality.

12-14 02:35:17.721    2953-3355/? E/DatabaseUtils﹕ Writing exception to parcel
java.lang.SecurityException: Permission Denial: get/set setting for user asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at com.android.server.am.ActivityManagerService.handleIncomingUser(ActivityManagerService.java:13082)
at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:2038)
at com.android.providers.settings.SettingsProvider.callFromPackage(SettingsProvider.java:577)
at android.content.ContentProvider$Transport.call(ContentProvider.java:279)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:273)
at android.os.Binder.execTransact(Binder.java:388)
at dalvik.system.NativeStart.run(Native Method)

I tried to add permission

android.permission.INTERACT_ACROSS_USERS_FULL

but still no sound. The strange thing is when I try to add INTERNET permission Android Studio 0.3 (ide I use) suggests me possible permissions I can choose. But when it comes to INTERACT_ACROSS_USERS_FULL permission it behaves like it has no idea about this permission. My test device is Samsung S4 running on 4.3.

I assume that I am not the only one who tries to use db on android. So there is a solution.

How can I really add INTERACT_ACROSS_USERS_FULL permission to my application?

Quarrelsome answered 14/12, 2013 at 0:57 Comment(8)
#19757227Gourmandise
Ok, I saw this post a few times. But what does it mean? How can I give my app same signature as system?Quarrelsome
You would have to either be the creator or they system, or convince them to sign your app - neither of which is realistic for most developers, ie, you can't. It really sounds like you are doing something unnecessarily odd. Have you tried to build a simple database example, dating from the days before multiuser support?Mcdonough
Thank you for your attention. I realized that the problem is not related to multiuser problem. Database operations work now. But this error keeps showing. It does not affect functionality at present but I wonder it becomes a problem later.Quarrelsome
Any solutions so far?Knitter
About this problem no, I could't find any.Quarrelsome
Does this bug appear on your SGS3? Or other devices give the same results?Iams
Please once check here it may be helpfull #28134628Karp
C
20

According to this answer: android.permission.INTERACT_ACROSS_USERS_FULL is a signature level permission. Your app will not be able to use it until and unless it has the same signature as the system.

Which is not something you can achieve unless you either are the creator or the system build, or collaborating with them such that they are willing to sign your apk with their certificate. In other words, this is off limits for most developers.

Charlotte answered 17/2, 2014 at 9:25 Comment(5)
Do I add this permission or not, why such a complex response ?Ogive
As the answer mentions, we cannot add this permission to our Android Manifest file unless your app is able to access system level signatures on your device. In other words (a.f.a.i.k.), this feature can only be used by the device OEMs.Charlotte
On a Samsung Device I get a exception if I dont use this. On a non samsung if I use it I get a exception. What do I do in this cae ?Ogive
@Siddharth: Yes, the issue is mostly consistent on Samsung devices (S3, particularly). This is usually just an exception, and does not affect the flow of your processes, so you may just ignore it. It seems to have been solved in S4. I'm not sure what can be done, if this is causing something to break in your app.Charlotte
I think you are right. I'll just let it be for now.Ogive
U
5

I got the error android.permission.INTERACT_ACROSS_USERS_FULL because I had some conflicts in the bin directory of the project. I did some changes to the my app package id and the app-file-1.apk in the bin directory doesn't match with the project.

I did a project > clean and checked that the bin folder was cleared and regenerated, and it works now.

Unseen answered 3/9, 2014 at 7:18 Comment(1)
Thank you, I was having this error on an updated Xamarin install and this really helped.Diecious
B
0

I had the same issue and think that I can help you out. I had registered my app with my production keystore, but was using Eclipse debug to load it into my phone. The Eclipse debug uses debug.keystore which wont match the signature of your production key and throw this error. Use the debug keystore instead for testing or send the apk to yourself and download it onto your phone.

Bicker answered 31/3, 2014 at 15:7 Comment(0)
G
0

I get this error when I change my minSdkVersion from 8 to 11 in my Manifest. I changed it back to 8 or 9 and no more error.

Try changing your minSdkVersion in your manifest. I was able to repeat the crash and error results with versions 10, 11, and 12 (my app crashes and displays "requires android.permission.INTERACT_ACROSS_USERS_FULL" in the LogCat)

Gossipy answered 16/4, 2014 at 17:47 Comment(0)
M
0

Try to disable auto-fill. It works 100% on Android Oreo. Check this link

Simply add this code to your app :

      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
        window.decorView.importantForAutofill = 
        View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS;
    }
Merous answered 30/3, 2018 at 11:53 Comment(2)
How is this an answer to the question?Dowling
I didn't remember where I read this, but it works for me. So, it may be one of the possible solutionsMerous

© 2022 - 2024 — McMap. All rights reserved.