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

Commit dcd40c0e authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Launch voice-based searches as current user

Launch the voice-based interactions (voice search, web search) as
 the current user.

Change-Id: I5a038feea24346c3c94f86097f574ffdc499cf60
parent 98427708
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -822,15 +822,17 @@ public class MediaFocusControl implements OnFinished {
        if (needWakeLock) {
            mMediaEventWakeLock.acquire();
        }
        final long identity = Binder.clearCallingIdentity();
        try {
            if (voiceIntent != null) {
                voiceIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
                        | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
                mContext.startActivity(voiceIntent);
                mContext.startActivityAsUser(voiceIntent, UserHandle.CURRENT);
            }
        } catch (ActivityNotFoundException e) {
            Log.w(TAG, "No activity for search: " + e);
        } finally {
            Binder.restoreCallingIdentity(identity);
            if (needWakeLock) {
                mMediaEventWakeLock.release();
            }