• 5
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

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?

      • 1
    • 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?
      • 1
    • 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.

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.

  • 20
Reply Report
      • 1
    • 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.
      • 2
    • 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 ?
      • 2
    • @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.

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.

  • 5
Reply Report

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.

  • 0
Reply Report

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)

  • 0
Reply Report

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;
    }
  • 0
Reply Report