Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e6e2d089 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am 3cb15637: Allow singleton providers to accept connections from other users

* commit '3cb156372b0b18030196e17f1d503e2a62531594':
  Allow singleton providers to accept connections from other users
parents 8a881cc3 a6f4d58b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
    private PathPermission[] mPathPermissions;
    private boolean mExported;
    private boolean mNoPerms;
    private boolean mSingleUser;

    private final ThreadLocal<String> mCallingPackage = new ThreadLocal<String>();

@@ -460,6 +461,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {

    boolean checkUser(int pid, int uid, Context context) {
        return UserHandle.getUserId(uid) == context.getUserId()
                || mSingleUser
                || context.checkPermission(INTERACT_ACROSS_USERS, pid, uid)
                == PERMISSION_GRANTED;
    }
@@ -1674,6 +1676,7 @@ public abstract class ContentProvider implements ComponentCallbacks2 {
                setWritePermission(info.writePermission);
                setPathPermissions(info.pathPermissions);
                mExported = info.exported;
                mSingleUser = (info.flags & ProviderInfo.FLAG_SINGLE_USER) != 0;
                setAuthorities(info.authority);
            }
            ContentProvider.this.onCreate();