I think onPreparePanel is what you're looking for. It is called right before the panel window is shown, every time it is shown. For GDK, that's right after the activity is created and also when a user taps the touchpad and the menu appears.
Return false when you want to disable the "Ok Glass":
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
Log.v(TAG, "CityRideActivity#onPreparePanel");
if (featureId == WindowUtils.FEATURE_VOICE_COMMANDS) {
return false; // <-- disable "Ok Glass"
}
return super.onPreparePanel(featureId, view, menu);
}
I guess Google Glass Chess disables the voice menu when the user taps the touch pad but the developer uses a custom view for his menu.
GDK doc has a brief explanation but quite helpful:
(Optional) Override onPreparePanel(), checking whether or not WindowUtils.FEATURE_VOICE_COMMANDS is enabled. If enabled, this is where you can do other logic to set up the menu system, such as adding and removing certain menu items based on some criteria. You can also toggle contextual voice menus on (return true) and off (return false) based on some criteria.