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

Commit ddd89a86 authored by Nate Myren's avatar Nate Myren
Browse files

Skip preflight RECORD_AUDIO in RecognitionService if FD provided

If a file descriptor is provided to a recognitionService using the
EXTRA_AUDIO_SOURCE option, then do not make a preflight RECORD_AUDIO
check

Test: manual
Bug: 226969470
Change-Id: Ibc9fa378f5375a38922f1791c13600a3a5ab55f1
parent 4220511d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -129,8 +129,9 @@ public abstract class RecognitionService extends Service {
            @NonNull AttributionSource attributionSource) {
        try {
            if (mCurrentCallback == null) {
                boolean preflightPermissionCheckPassed = checkPermissionForPreflightNotHardDenied(
                        attributionSource);
                boolean preflightPermissionCheckPassed =
                        intent.hasExtra(RecognizerIntent.EXTRA_AUDIO_SOURCE)
                        || checkPermissionForPreflightNotHardDenied(attributionSource);
                if (preflightPermissionCheckPassed) {
                    if (DBG) {
                        Log.d(TAG, "created new mCurrentCallback, listener = "