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

Commit 6da7746a authored by Atneya Nair's avatar Atneya Nair
Browse files

Fix Perm issues in STService

Temporary fix to avoid spurious permission issues in middleware
service until the permission utilities are fixed properly.

VIMService does its own permission gating, so we aren't losing
any checks.

Bug: 269765333
Test: AGSA starts recognition successfully
Change-Id: Ifa6368f54d2f0f782183fd77036953bddbc02172
parent a0961285
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1647,11 +1647,13 @@ public class SoundTriggerService extends SystemService {

        @Override
        public List<ModuleProperties> listModuleProperties(Identity originatorIdentity) {
            Identity middlemanIdentity = new Identity();
            middlemanIdentity.packageName = ActivityThread.currentOpPackageName();
            Identity identity = new Identity();
            identity.packageName = ActivityThread.currentOpPackageName();
            ArrayList<ModuleProperties> moduleList = new ArrayList<>();
            SoundTrigger.listModulesAsMiddleman(moduleList, middlemanIdentity,
                                            originatorIdentity);
            // Overwrite with our own identity to fix permission issues.
            // VIMService always does its own validation, so this is fine.
            // TODO(b/269765333)
            SoundTrigger.listModulesAsOriginator(moduleList, identity);
            return moduleList;
        }