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

Commit 04a474f3 authored by Atneya Nair's avatar Atneya Nair
Browse files

Fix headless package-check issue in soundtrigger

Change package/UID check to match against any user to avoid cases where
the client app is not installed in SYSTEM_USER (headless) to cause
package manager to fail to find the package name and throw a security
exception.

Bug: 290462753
Bug: 288949320
Test: Assistant in headless mode
Change-Id: I8c804314c197890059c9a5d6184a923ce075ce61
parent f20259e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ public class SoundTriggerService extends SystemService {
            // Validate package name
            try {
                int uid = mPackageManager.getPackageUid(mOriginatorIdentity.packageName,
                        PackageManager.PackageInfoFlags.of(0));
                        PackageManager.PackageInfoFlags.of(PackageManager.MATCH_ANY_USER));
                if (!UserHandle.isSameApp(uid, mOriginatorIdentity.uid)) {
                    throw new SecurityException("Uid " + mOriginatorIdentity.uid +
                            " attempted to spoof package name " +