Saturday, August 24, 2013

[APK Teardown] Google Search 2.7: Custom Hotwords, Photo Downloads, Automatic Language Pack Updates, And More


A couple of days ago, Google dropped a pretty sweet but surprising late-night update to Google Search with version 2.7.9. You can read about the announced features and download the APK here, if you haven't yet. After the dust settled, I jumped right into the multitude of under-the-hood changes and was able to uncover quite a few things not included in the changelog - both ones that are coming in the future and ones that are already here.

Let's take a look at the new stuff that wasn't mentioned first and then jump to things that may be arriving soon. Teardown season is open, and you're all invited for a ride!

androidpolice.com/wp-content/uploads/2013/08/nexusae0_apk-search-teardown1.png">apk-search-teardown

New stuff that's already here

Image downloads

One of the most functional and useful changes is the ability to download images when using image search. The image you are trying to save gets queued up and downloaded in the notification area, just as you'd expect. Here you can see my Note II with Search 2.6 vs the Nexus 4 with Search 2.7:

wm_Screenshot_2013-08-22-01-39-37wm_Screenshot_2013-08-22-01-40-16

Left: old Search; Right: new Search

Ongoing reminders

Search 2.7 has a new area under Settings -> My Stuff -> Reminders called Ongoing. By default, all your upcoming reminders go to Upcoming and your past ones to Past. So what goes into Ongoing?

As it turns out, this is exactly how the new functionality to remind you about book, album, and TV episode releases is exposed. For example, when browsing Google for "breaking bad," you will see a card with the information about Breaking Bad, along with a new Remind me button. Set it, and the reminder will go straight into your Ongoing reminders section:

8-23-2013 9-45-53 AM

wm_8-23-2013 9-45-38 AMwm_Screenshot_2013-08-23-09-48-00

This weekend in reminders

Reminders now support "This weekend." Search understood this phrase before, but displayed it as one of the upcoming days of the week, whereas now it simply says "Weekend."

This weekend

wm_Screenshot_2013-08-24-14-22-53wm_Screenshot_2013-08-22-14-22-38

Left: old Search; Right: new Search

New date/time pickers

Search 2.7 uses new date and time pickers that I personally really love but others hate for some reason. We saw them first in Google Calendar back in May. Props to Ron for spotting this change.

wm_Screenshot_2013-08-24-14-20-14wm_Screenshot_2013-08-21-15-06-45wm_Screenshot_2013-08-24-14-20-31wm_Screenshot_2013-08-22-15-07-35

New Loyalty Programs card?

There is a new Google Now card called Loyalty Programs. Ron found the upcoming Loyalty card functionality in a previous teardown of Search v2.6, and now the card is here. But what does it do? Especially since gift and loyalty cards were cut from Wallet on August 21.

wm_Screenshot_2013-08-22-04-26-15

Next Appointment card now lets you select the calendars you want

Yay, you can now hand-pick only the calendars you want for the Next appointment card and notifications. Awesome:

wm_Screenshot_2013-08-22-04-28-57wm_Screenshot_2013-08-22-04-28-50

Reminders now have a Remind me in 10 minutes/1 hour button

When a reminder card pops up, you now have the option to snooze it for 10 minutes. Pressing 10 minutes changes the prompt to 1 hour. Handy:

wm_Screenshot_2013-08-22-04-48-07wm_Screenshot_2013-08-22-04-47-27wm_Screenshot_2013-08-22-04-48-23

Left: old Search; Middle, Right: new Search

Sound search will no lon ger hang if you have no connection

If your connection is shaky and you try to identify a song that's playing on the radio around you, the old Search would listen and then hang indefinitely at the end. The new Search will error out right away to avoid the frustration. Here's a test I ran using Airplane mode:

wm_Screenshot_2013-08-22-03-54-52wm_Screenshot_2013-08-22-03-54-44

Left: old Search; Right: new Search

Translate button changed to Open in Google Translate

The Translate card that pops up when you travel now says Open in Google Translate instead of just Translate. Here's what the old card looked like:

Translate

Open in Google Translate

(NEW) You can now edit upcoming reminders

Previously, upcoming reminders could only be deleted, whereas now you can both edit and delete them.

(Thanks, Barry!)

wm_Screenshot_2013-08-24-19-24-07wm_Screenshot_2013-08-24-19-24-26

Left: old Search; Right: new Search

Stuff that may be coming at some point

Custom hotwords

Right now, Google Search can be activated using voice by saying the hotword "Google." It looks like custom hotwords are coming and can even be controlled by adding a file called hotword_prompt.txt somewhere in the language model. I'm not sure what format the file needs to be in, and where it needs to be placed exactly though - I tried a few things but the hotword didn't change. There is also goin g to be a hotword setting so you can change it directly from the app.

wm_Screenshot_2013-08-24-13-37-07

The current Voice settings in Search 2.7

In Search 2.6, the hotword prompt had Google hardcoded into the string:

Search, or say Google

Say Google to launch voice search.

In Search 2.7, it's now a variable:

Search, or say %1$s

Say %1$s to launch voice search.

Here are related new functions:

getHotwordPrompt()

addHotwordPrompt()

And the hotword_prompt.txt-related code snippet:

else if ("hotword_prompt.txt".equals(localFile.getName()))
localLocaleResourcesImpl.addHotwordPrompt(localFile);

Auto-updating voice recognition language packs

Right now, yo u can download offline language packs, and they'll sit on your device in the same state, without any updates. Obviously, Google is improving language processing all the time, so it's only natural that they'll want to keep offline recognition updated as well. Auto-updates are coming, and there will even be a separate tab to configure the auto-update settings.

Auto-update
Do not auto-update languages
"Auto-update languages at any time. Data charges may apply."
Auto-update languages over Wi-Fi only
Disable auto-update?
Prevent future downloads by disabling automatic updates of all languages< /p>

This code will enable the extra settings tab:

if (Feature.LANGUAGE_PACK_AUTO_DOWNLOAD.isEnabled())
this.mTabsAdapter.addTab(localActionBar.newTab().setText(2131363178), VoiceAutoUpdateRadioButtonFragment.class, new Bundle());

wm_Screenshot_2013-08-24-13-55-39

Multiple choice training questions?

The new Google Search has a lot of new files related to trai ning and asking the user various questions, possibly on the back of Now cards. Some questions are multiple choice and some are yes/no:

  • trainingMultipleChoiceQuestionView
  • trainingQuestionKey
  • trainingTraining
  • trainingTrainingBackOfCardAdapter
  • trainingTrainingQuestion
  • trainingTrainingQuestionManagerImpl
  • trainingTrainingQuestionViewHelper
  • trainingYesNoQuestionView

These puzzle me - some questions are answered locally and some remotely?

  • addServerAnsweredQuestion()
  • addClientAnsweredQuestion()

There are also a bunch of new training-related icons and buttons:

  • btn_training_next, btn_training_no, btn_training_prev, btn_training_yes
  • ic_action_info_training
  • ic_training_add, ic_training_biking, ic_training_driving, ic_training_edit, ic_training_hide, ic_training_people, ic_training_public_transit, ic_training_show, ic_training_tempunits, ic_training_walking
  • training_vertical_divider

image

New features being tested

Remember that Feature.LANGUAGE_PACK_AUTO_DOWNLOAD flag I showed you earlier in the auto-update section? There are a whole lot more of these secret flags that enable various hidden things around the app:

FOLLOW_ON = new Feature("FOLLOW_ON", 3, false);
FORCE_EYES_FREE = new Feature("FORCE_EYES_FREE", 4, false);
FORCE_CAR_MODE = new Feature("FORCE_CAR_MODE", 5, false);
LANGUAGE_PACK_AUTO_DOWNLOAD = new Feature("LANGUAGE_PACK_AUTO_DOWNLOAD", 6, fa lse);
LOG_CONTACT_DATA = new Feature("LOG_CONTACT_DATA", 7, false);
REMINDERS_LEAVING_TRIGGER = new Feature("REMINDERS_LEAVING_TRIGGER", 8, false);
REMINDERS_WEEKEND = new Feature("REMINDERS_WEEKEND", 9, true);
SEARCH_HISTORY_IN_APP = new Feature("SEARCH_HISTORY_IN_APP", 10, false);
TEST_FEATURE = new Feature("TEST_FEATURE", 11, false);
TTS_NOVICE_MODE = new Feature("TTS_NOVICE_MODE", 12, false);
TTS_PREFIX_USERNAME = new Feature("TTS_PREFIX_USERNAME", 13, false);
TWO_STEP_DISAMBIG = new Feature("TWO_STEP_DISAMBIG", 14, false);
SHOW_LOGGING_TOASTS = new Feature("SHOW_LOGGING_TOASTS", 15, false);

Some are self-explanatory, some aren't, so I don't know what all of them do. But it's exciting that there's a way to see what's cooking by looking in this area of searchcommon/Feature.java.

I'm especially interested in TWO_STEP_DISAMBIG, which seems to enable a different UI for figuring out wh ich contact you're trying to select when multiple ones match as well as FOLLOW_ON, FORCE_* - hell, I'm interested in all of them.

Debug options

With some help from my new friend Paul Price, we managed to enable some debug options, just for fun. Here are some screenshots:

debug1debug2debug3

This is all I have for you today. As you can see, since Ron's no longer with us, I've taken over the teardowns (at least until we find Ron 2.0), and it's my goal to not only continue them here at AP where they started, but make them better, more detailed, and more in-depth than ever before.

No comments:

Post a Comment