Fatal Exception: java.lang.SecurityException: Permission Denial: broadcast from android asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL or android.permission.INTERACT_ACROSS_USERS
at android.os.Parcel.readException(Parcel.java:1665)
at android.os.Parcel.readException(Parcel.java:1618)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:4195)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:5771)
at android.app.ContextImpl$ApplicationContentResolver.acquireProvider(ContextImpl.java:2415)
at android.content.ContentResolver.acquireProvider(ContentResolver.java:1507)
at android.content.ContentResolver.call(ContentResolver.java:1477)
我不知道发生了什么。我只想通过以下代码跨进程读取数据:
context.getApplicationContext().getContentResolver().call(uri, method, arg, extras);
当崩溃发生时,我确定我不涉及任何多用户操作。当我的应用通过上下文提供者完成此过程时,将随机发生此错误。而且我无法在华为模型上重现该问题。
答案 0 :(得分:1)
在清单中使用这些权限之一
android.permission.INTERACT_ACROSS_USERS_FULL
或
android.permission.INTERACT_ACROSS_USERS