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

Commit 5c20404b authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SoundTriggerService.startRecognition - callingUser" into main

parents b5a7b757 8e423d11
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -687,6 +687,7 @@ public class SoundTriggerService extends SystemService {
        @Override
        @Override
        public int startRecognitionForService(ParcelUuid soundModelId, Bundle params,
        public int startRecognitionForService(ParcelUuid soundModelId, Bundle params,
                ComponentName detectionService, SoundTrigger.RecognitionConfig config) {
                ComponentName detectionService, SoundTrigger.RecognitionConfig config) {
            final UserHandle userHandle = Binder.getCallingUserHandle();
            mEventLogger.enqueue(new SessionEvent(Type.START_RECOGNITION_SERVICE,
            mEventLogger.enqueue(new SessionEvent(Type.START_RECOGNITION_SERVICE,
                        getUuid(soundModelId)));
                        getUuid(soundModelId)));
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
            try (SafeCloseable ignored = ClearCallingIdentityContext.create()) {
@@ -699,7 +700,7 @@ public class SoundTriggerService extends SystemService {


                IRecognitionStatusCallback callback =
                IRecognitionStatusCallback callback =
                        new RemoteSoundTriggerDetectionService(soundModelId.getUuid(), params,
                        new RemoteSoundTriggerDetectionService(soundModelId.getUuid(), params,
                                detectionService, Binder.getCallingUserHandle(), config);
                                detectionService, userHandle, config);


                synchronized (mLock) {
                synchronized (mLock) {
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());
                    SoundModel soundModel = mLoadedModels.get(soundModelId.getUuid());