Search code examples
google-glassgoogle-gdk

Google Glass XE 17.3 - Multiple Actions From One Voice Trigger Broken?


One of my pairs of Glass updated itself to XE 17.3 this morning, and now, any Voice Triggers I have defined that are used for more than one activity no longer work. On previous versions, (and I've tested my code on an XE 17.2 pair I have to make sure I didn't break anything today), if multiple activities were set to use the same Voice Trigger, the system would prompt you to select from a list upon hearing that voice trigger. This is expected behavior (in case two applications use the same trigger), and actually was quite useful for creating a sub-launcher for your application (which is what I was using it for...say main launch name -> get a list of activities to choose from within the app, all automatic and handled by the system).

Now, however, if my Voice Trigger is assigned to two or more activities within my manifest, it will show up in the list, but will never trigger when you say "OK Glass - [voice trigger]" (it does still work with taps, however). As I mentioned, I tested the exact same code on a pair running XE 17.2 and it worked fine. I also removed the trigger from all but one activity, and it works on 17.3 when you do that...so the problem is when you have more than one possible activity that handles a given voice trigger.

The way I have my manifest set up seems correct to me (and works on older versions of the firmware):

<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />

...

<!-- one of the activities. this is inside the application element, of course -->

<activity
    android:name="com.someapp.MainActivity"
    android:label="Option 1" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
    </intent-filter>
    <meta-data
        android:name="com.google.android.glass.VoiceTrigger"
        android:resource="@xml/voiceinput_main" />
</activity>

<!-- another activity, again inside the application element, sharing the same trigger -->
<activity
    android:name="com.someapp.AnotherActivity"
    android:label="Option 2" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
    </intent-filter>
    <meta-data
        android:name="com.google.android.glass.VoiceTrigger"
        android:resource="@xml/voiceinput_main" />
</activity>

And, this manifest works fine on XE 17.2. Anyone know of something that has changed in 17.3 that would break this, or see anything that looks wrong? I know that the <action android:name="android.intent.action.MAIN" /> line isn't necessary, but removing it doesn't fix the problem.

Thanks!


Solution

  • in my case, I change my voice trigger string "all in lower case" thing solved my problem, maybe you could give it a try, custom Voice trigger command XE17.31