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

Commit acd73062 authored by Dhina17's avatar Dhina17
Browse files

PhoneWindowManager: Pass correct invocation type for assistant launch on home long press

When we launch assistant by long pressing home button,
we should pass the INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS as invocation type.

It was modified by mistake in I8e8af90ac8fc7e96f73f2c68056de533d9157fa6.

Change-Id: Id38b8f72f605a26b5fd6c976b2e37a26ed97c569
parent 28152d89
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -1990,6 +1990,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    private void performKeyAction(Action action, KeyEvent event) {
        // By default, pass INVOCATION_TYPE_UNKNOWN to launch assistant.
        performKeyAction(action, event, AssistUtils.INVOCATION_TYPE_UNKNOWN);
    }

    private void performKeyAction(Action action, KeyEvent event, int assistInvocationType) {
        switch (action) {
            case NOTHING:
                break;
@@ -2001,7 +2006,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                break;
            case SEARCH:
                launchAssistAction(null, event.getDeviceId(), event.getEventTime(),
                       AssistUtils.INVOCATION_TYPE_UNKNOWN);
                       assistInvocationType);
                break;
            case VOICE_SEARCH:
                launchVoiceAssistWithWakeLock();
@@ -2148,7 +2153,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    mHomePressed = true;
                    performHapticFeedback(HapticFeedbackConstants.LONG_PRESS, false,
                            "Home - Long Press");
                    performKeyAction(mHomeLongPressAction, event);
                    // If long press home will launch assistant,
                    // it should pass this right invocation type.
                    performKeyAction(mHomeLongPressAction, event,
                            AssistUtils.INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS);
                    if (mHomeLongPressAction != Action.SLEEP) {
                        mHomeConsumed = true;
                    }