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

Commit 2c54e625 authored by Eugene Susla's avatar Eugene Susla Committed by Automerger Merge Worker
Browse files

RESTRICT AUTOMERGE am: e8551a88 am: 6b6c1353

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12950101

Change-Id: I2d4bc8b16fe0a709a8a4560a4e685e98c89e570d
parents 83739b6d 6b6c1353
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import static com.android.internal.util.Preconditions.checkState;
import android.Manifest;
import android.annotation.CheckResult;
import android.annotation.Nullable;
import android.app.AppOpsManager;
import android.app.PendingIntent;
import android.companion.AssociationRequest;
import android.companion.CompanionDeviceManager;
@@ -275,7 +276,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind

            checkArgument(getCallingUserId() == userId,
                    "Must be called by either same user or system");
            mAppOpsManager.checkPackage(Binder.getCallingUid(), pkg);
            int callingUid = Binder.getCallingUid();
            if (mAppOpsManager.checkPackage(callingUid, pkg) != AppOpsManager.MODE_ALLOWED) {
                throw new SecurityException(pkg + " doesn't belong to uid " + callingUid);
            }
        }

        @Override