fwb: Introduce constant for assist hw button.

Since there's a dedicated KEYCODE associated with
the invocation, don't utilize UNKNOWN to represent it.

Test: manual
Bug: 277271303
Change-Id: Ie743180d10b9c68309784aa623036dbbb574ac54
This commit is contained in:
Adnan Begovic
2023-04-19 19:15:17 +00:00
parent b7abd25362
commit a55decab8e
2 changed files with 3 additions and 1 deletions

View File

@@ -57,6 +57,8 @@ public class AssistUtils {
public static final int INVOCATION_TYPE_HOME_BUTTON_LONG_PRESS = 5;
/** value for INVOCATION_TYPE_KEY: long press on physical power button */
public static final int INVOCATION_TYPE_POWER_BUTTON_LONG_PRESS = 6;
/** value for INVOCATION_TYPE_KEY: press on physcial assistant button */
public static final int INVOCATION_TYPE_ASSIST_BUTTON = 7;
private final Context mContext;
private final IVoiceInteractionManagerService mVoiceInteractionManagerService;

View File

@@ -710,7 +710,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
final int deviceId = msg.arg1;
final Long eventTime = (Long) msg.obj;
launchAssistAction(null /* hint */, deviceId, eventTime,
AssistUtils.INVOCATION_TYPE_UNKNOWN);
AssistUtils.INVOCATION_TYPE_ASSIST_BUTTON);
break;
case MSG_LAUNCH_VOICE_ASSIST_WITH_WAKE_LOCK:
launchVoiceAssistWithWakeLock();