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

Commit 6a4db881 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Filter out user handle in ST package check" into udc-dev

parents 3a09e0c0 c253a493
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -366,10 +366,10 @@ public class SoundTriggerService extends SystemService {
            try {
                int uid = mPackageManager.getPackageUid(mOriginatorIdentity.packageName,
                        PackageManager.PackageInfoFlags.of(0));
                if (uid != mOriginatorIdentity.uid) {
                    throw new SecurityException("Package name: " +
                            mOriginatorIdentity.packageName + "with uid: " + uid
                            + "attempted to spoof as: " + mOriginatorIdentity.uid);
                if (!UserHandle.isSameApp(uid, mOriginatorIdentity.uid)) {
                    throw new SecurityException("Uid " + mOriginatorIdentity.uid +
                            " attempted to spoof package name " +
                            mOriginatorIdentity.packageName + " with uid: " + uid);
                }
            } catch (PackageManager.NameNotFoundException e) {
                throw new SecurityException("Package name not found: "