Friday, April 18, 2014

[APK Teardown] Glass XE16 Settings App Exposes New Languages, Sync Settings, And Detects When You're Looking At The Screen

2014-04-18 06.37.37

It seems like forever since we did our last teardown for Google Glass, but that doesn't mean there aren't a lot of things happening for the former Google[x] project. XE16 brought the first ever change in OS version, taking Glass from 4.0.4 (Ice Cream Sandwich) all of the way to 4.4.2 (KitKat). A minor hotfix from build followed with an undisclosed set of changes and a minor bump in build number.

Since this is such a massive update to Glass and the changes are so substantial, this teardown is going to come in multiple parts. I'll start with the GlassSettings.apk and we'll hit some more over the next few days. Trust me, this one deserves a post all to itself.

New Languages

It's safe to say that a lot of people are displeased with Google for launching most of its products on home turf before expanding outside of the United States. Whether this is always a fair or reasonable criticism is a debate for another time. While there was never any doubt that Glass (or a consumer variant) would eventually make its way around the world, there have been questions about where it would be headed first. It looks like we might have some answers.

In XE12, Glass only supported US English, there weren't even localization folders for other languages. XE16 includes fairly complete translations to German, UK English, and Japanese. There is also a folder for Ukrainian, but it's only about 20% complete.

Screen Shot 2014-04-17 at 3.14.34 AM

In addition to the language files, the other necessary support elements seem to also be present. There is a layout named language_settings_item.xml and a LanguageSettingsItemView class which includes code further supporting this list.

PSEUDO_LOCALE_ACCENT = new Locale("en", "xa");

SUPPORTED_LOCALES = com.google.common.collect.ImmutableList.of(java.util.Locale.US, java.util.Locale.UK, java.util.Locale.JAPANESE, PSEUDO_LOCALE_ACCENT);

BlZs14pCcAAwS9f

Photo: Jeremy

The evidence is pretty overwhelming, but it doesn't tell us anything about when new languages will be enabled or the Explorer Program might be opening up to new countries. This could all simply be in preparation for an eventual consumer release.

Glass Is Watching You Watching It

Glass has had an on-and-off relationship with the Wink gesture, with it first being usable only through an unofficial app called Winky, and later gaining official support in XE12. We've long known that there is a small sensor pointed directly at the wearer's eye, but until now it has only been used for the Wink gesture and detecting that Glass is actually being worn (ie. Head-on detection). It looks like that sensor is about to gain a new trick - it can detect when you're focusing on the Glass display instead of your surroundings.

2014-04-17 04_03_25.prp2014-04-17 04_04_452014-04-17 04_05_10

The feature is partially functional in a new calibration activity. The wearer is asked to look away from the screen for about 2 seconds, then look directly at the screen. It's clear this is still a work in progress because the process is supposed to also include a video behind the instructions, but the screen remains black and there is no appropriate video included with the firmware. This setup process doesn't have an entry point from the Glass interface yet, but you can start it up by connecting to a computer and entering this command:

adb shell am start -n com.google.glass.settings/.ui.LookAtScreenCalibrationActivity

The calibration process can only be run once. Subsequent attempts will immediately kick up the message "Failed to calibrate," as seen in the third screenshot. Rebooting Glass resets the activity and allows it to go through the setup again, but it still only allows a single run. If you're feeling particularly drawn to experimentation and you've rooted Glass, it's possible to enable access to the calibration feature directly through Settings by modifying the apk to turn on debug mode and enabling LASER_RLU.

BlZsJnoCIAAJ3mD

Credit: Jeremy for discovering the hack

This feature doesn't seem to be in use yet, but Glass will probably use this to turn the display on and off with the wearer's gaze. The end result would be faster, more intuitive, and considerably less awkward than the nod gesture we currently have.

    <string name="look_at_screen_enable_title">Look At Screen</string>

    <string name="look_at_screen_menu_calibrate">Calibrate</string>

    <string name="look_at_screen_card_footer">Experimental feature</string>

    <string name="look_at_screen_menu_turn_off">Turn off</string>

    <string name="look_at_screen_turning_off">Turning off</string>

    <string name="look_at_screen_turned_on">Turned on</string>

    <string name="look_at_screen_turned_off">Turned off</string>

    <string name="look_at_screen_off_status">is OFF</string>

    <string name="look_at_screen_on_status">is ON</string>

    <string name="look_at_screen_menu_setup">Calibrate</string>

    <string name="look_at_screen_menu_help">Help</string>

    <string name="look_at_screen_toggle_failure">Failed to toggle state</string>

    <string name="look_at_screen_calibration_instruction">Look down away from screen then look back.</string>

    <string name="look_at_screen_calibration_failure">Failed to calibrate</string>

    <string name="look_at_screen_calibrated_confirmation">Calibrated</string>

    <string name="look_down_tts">Look Down</string>

    <string name="look_at_screen_tts">Now Look At Screen</string>

New Iconography

Every update to Glass includes some new icons and this one is no exception. This time around, quite a few icons were moved from the framework libraries to the individual apks, so some of these are going to be familiar to anybody who has used Glass. I've left out a few completely innocuous additions, like WiFi and Bluetooth indicators. It's known that the Glass team occasionally adds resources at the behest of 3rd-party app developers, so it's quite possible that some of these will never actually find their way into the UI of Google's own software.

nav_icons

This group is oriented towards location-based activities of some kind or another. There are icons for different types of conveyance, finding and sharing your location, and initiating searches for specific types of places and services. The one that peaks my interest is find_product, which I hope to see used in a feature where the user asks Glass to find a nearby store to purchase a product they need.

operational_icons

Here we can see several of the more operational functions, icons for things that are specific to the device or consuming information. Utility functions run across the top and camera-related material is in the bottom left. The option to send money is really interesting, because it's something that hasn't been explored all that much before.

The three icons in the bottom right are a bit random. The tuner has been floating around since XE11, but it has never been used. Danger is easy to understand, but it's not really obvious if it will be used in. And then there's the flashlight... There is a string in GlassVoice to turn off the flashlight, so this might add to the evidence of a new hardware feature in the consumer release.

Battery Duration

Battery life has always been a fairly contentious subject with Android, but it's an undeniable problem for most Glass users. After all, if you're listening to music or recording video, it's actually fair to measure rundown in minutes. Of course, knowing what percentage remains doesn't always translate to how much longer you've got left until the dreaded low battery warning appears. It looks like the Settings app will account for this by showing an estimate of time remaining.

    <string name="battery_duration_unknown">Duration unknown</string>

    <string name="battery_duration_hours_minutes" formatted="false">%s hr %s min</string>

    <string name="battery_duration_minutes">%s min</string>

This is all driven by a new BatteryHelper class that can ask the system how long it should take for Glass to discharge. Naturally, this will just be a best guess based on usage patterns, but it will be helpful. Unfortunately, it looks like this feature is still waiting to make an appearance.

Sync Settings

Glass is definitely meant to be an Internet-connected device; almost anything of substance that can be done with it relies on calling out to a server somewhere. The camera functionality is one of the few meaningful exceptions. Even though a connection isn't required, it still automatically syncs photos and video to your Google+ account once a viable connection is established. However, it looks like there are going to be a few configuration options to control how syncing works. In a sub-menu named Auto Backup, there will be options to turn on sync for everything, just photos, or nothing at all.

There are also new error and status messages that should make it more obvious when syncing is happening and when it has completed or failed. So far, these things have been a bit of a guessing game. None of this is currently available through the interface, but everything looks fairly complete and ready for action. It's possible Google could flip a switch on a server to enable this stuff at any time.

sync_settings_menu.xml:

<menu xmlns:android="http://ift.tt/nIICcg">;

<item android:icon="@drawable/ic_sync_50" android:id="@id/sync_item_all" android:title="@string/sync_action_all" />

<item android:icon="@drawable/ic_sync_50" android:id="@id/sync_item_photos" android:title="@string/sync_action_photos" />

<item android:icon="@drawable/ic_delete_50" android:id="@id/sync_item_clear" android:title="@string/sync_action_clear" />

</menu>

Strings:

<string name="sync_settings_header">Auto Backup</string>

<string name="sync_action_all">Back up all</string>

<string name="sync_action_clear">Clear</string>

<string name="sync_action_confirm">Confirm</string>

<string name="sync_action_photos">Back up photos</string>

<string name="sync_message_scanning">Scanning…</string>

<string name="sync_message_all_synced">Photos and videos have been backed up to Google+</string>

<string name="sync_message_auto_wifi_charging_long">Photos and videos back up when charging and on wifi</string>

<string name="sync_message_cleared">Cleared</string>

<string name="sync_message_clearing">Clearing</string>

<string name="sync_message_connectivity_required">Connectivity is required</string>

<string name="sync_message_progress">%d items backing up to Google+</string>

<string name="sync_message_progress_one">1 item backing up to Google+</string>

<string name="sync_message_some_not_synced_full_res">Some items were not backed up in full-res</string>

<string name="sync_message_started">Started</string>

<string name="sync_message_starting">Starting</string>

<string name="sync_message_unsynced_items">%d items ready for back up to Google+</string>

<string name="sync_message_unsynced_items_one">1 item ready for back up to Google+</string>

<string name="sync_message_pending_work" formatted="false">%d items at %s will be backed up</string>

<string name="sync_message_pending_work_one">1 item at %s will be backed up</string>

<string name="sync_message_pending_work_zero">0 items will be backed up</string>

<string name="sync_message_clear_will_remove">%d backed up items will be removed from device</string>

<string name="sync_message_clear_will_remove_one">1 backed up item will be removed from device</string>

Wrap-Up

That's it for the Settings app. There's some pretty nifty stuff here, especially the look detection and the likely expansion into other countries. There's still plenty more to come, so I'll be back with more teardown goodness really soon!

Cody Toombs
Cody is a Software Engineer and Writer with a mildly overwhelming obsession with smartphones and the mobile world. If he’s been pulled away from the computer for any length of time, you might find him talking about cocktails and movies, sometimes resulting in the consumption of both.


source: androidpolice

0 comments :