0

Background

Google assistant app (AKA "Google-Now-On-Tap" and "Google Now") can be triggered on Pixel 2 devices by squeezing the device, using a feature called "Active edge" :

enter image description here

To check if the current app is the default assistant app, you can use this:

    String assistant = Settings.Secure.getString(getContentResolver(), "voice_interaction_service");
    ComponentName cn = assistant == null ? null : ComponentName.unflattenFromString(assistant);
    boolean isDefaultAssistant = cn != null && cn.getPackageName().equals(getPackageName());

And to get to a settings screen for it, you can use this:

startActivity(new Intent(Settings.ACTION_VOICE_INPUT_SETTINGS));

The problem

As it's hard to find docs and samples for making an assistant app, I can't find if it's possible to do the same for third party apps.

When I try it myself, or use a sample I've found, I see only those:

enter image description here

Not only that, but for some reason the "flash screen" can't be clicked. Not sure if it's considered turned-on though.

What I've found

I've found some samples showing how to make an assistant app, mainly "AssistLogger" from "commonsguy" repo "cw-omnibus" :

https://github.com/commonsguy/cw-omnibus/tree/master/Assist/AssistLogger

Thing is, I tried various API calls there, but I couldn't find how to enable this feature.

The questions

  1. Is it possible to enable this feature for third party assistant apps? If so how? If not, why?

Bonus questions (because I couldn't find them too) :

  1. How come "flash screen" is unclickable?

  2. Is it possible to choose what to show on this screen, or what to disable from toggling ?

  3. Is there an Intent to go to the chooser of assistants instead of what I've shown?

  4. Is it possible to check what is the state of each toggle? For example if the user has unchecked the one of screenshot?

android developer
  • 114,585
  • 152
  • 739
  • 1,270

0 Answers0