Merge "RESTRICT AUTOMERGE Fix CDM package check" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e0d7430c0e
@@ -25,6 +25,7 @@ import static com.android.internal.util.function.pooled.PooledLambda.obtainRunna
|
|||||||
|
|
||||||
import android.annotation.CheckResult;
|
import android.annotation.CheckResult;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.app.AppOpsManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.companion.AssociationRequest;
|
import android.companion.AssociationRequest;
|
||||||
import android.companion.CompanionDeviceManager;
|
import android.companion.CompanionDeviceManager;
|
||||||
@@ -297,7 +298,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
|
|||||||
|
|
||||||
checkArgument(getCallingUserId() == userId,
|
checkArgument(getCallingUserId() == userId,
|
||||||
"Must be called by either same user or system");
|
"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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user