Remove RECORD_AUDIO requirement for ST listModules

No reason to require RECORD pre-flight permissions to query dsp module
properties. CAPTURE_AUDIO_HOTWORD, which is a non-runtime permission,
should suffice to ensure only valid ST clients can call this method.

We will still require RECORD for the rest of the methods, which actually
begin to interact with the hardware.

Bug: 272147641
Fixes: 279839210
Test: SoundTriggerManagerTest
Change-Id: Ibf61fe8f26169dff754dbd40f385793b325707de
This commit is contained in:
Atneya Nair
2023-04-26 19:14:29 -07:00
parent 29c38dc24a
commit 87a4ad07d2

View File

@@ -78,7 +78,7 @@ public class SoundTriggerMiddlewarePermission implements ISoundTriggerMiddleware
public @NonNull
SoundTriggerModuleDescriptor[] listModules() {
Identity identity = getIdentity();
enforcePermissionsForPreflight(identity);
enforcePermissionForPreflight(mContext, identity, CAPTURE_AUDIO_HOTWORD);
return mDelegate.listModules();
}