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

Commit b2d3d3ab authored by Ytai Ben-Tsvi's avatar Ytai Ben-Tsvi
Browse files

Fix permission checking in SoundTriggerService

Result of permission check was erroneously ignored instead of
throwing.

Fixes: 191597651
Test: Manual verification of basic soundtrigger flows (assistant, now
      playing) against regression.
      Requested reporter to repro bug.
Change-Id: I73449a156308880dae9ca5d432df3bc5ee747e58
parent b886e41a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -863,7 +863,12 @@ public class SoundTriggerService extends SystemService {
        }

        private void enforceCallingPermission(String permission) {
            PermissionUtil.checkPermissionForPreflight(mContext, mOriginatorIdentity, permission);
            if (PermissionUtil.checkPermissionForPreflight(mContext, mOriginatorIdentity,
                    permission) != PackageManager.PERMISSION_GRANTED) {
                throw new SecurityException(
                        "Identity " + mOriginatorIdentity + " does not have permission "
                                + permission);
            }
        }

        private void enforceDetectionPermissions(ComponentName detectionService) {