Fixed Attribution Source’s calling Uid check for multiuser.
The method UserHandle.getAppId() strips off the part of the Uid that is related to the current user (which may not be zero for multiuser). Bug: 236100828 Change-Id: Ie27c8570ba2551b6d99d9848a0b2469fe76ac3d1
This commit is contained in:
@@ -29,6 +29,7 @@ import android.os.IBinder;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.permission.PermissionManager;
|
||||
import android.util.ArraySet;
|
||||
|
||||
@@ -297,7 +298,7 @@ public final class AttributionSource implements Parcelable {
|
||||
public boolean checkCallingUid() {
|
||||
final int callingUid = Binder.getCallingUid();
|
||||
if (callingUid != Process.ROOT_UID
|
||||
&& callingUid != Process.SYSTEM_UID
|
||||
&& UserHandle.getAppId(callingUid) != Process.SYSTEM_UID
|
||||
&& callingUid != mAttributionSourceState.uid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user