[X 2014 Original Android Development] crpalmer:
Device Specific Functionality

Device Specific Functionality

Victara has some unique hardware and this allows us to have some special functionality which mimics some of Motorola's custom software.

User-aware display

The sensors on the phone allow it to recognize if someone (or something) is in front of the screen. In Settings >> Gestures >> User-aware display, you can enable this feature (disabled by default) that will always keep the screen on when an object is in front of it. The object detection starts as soon as the phone is unlocked and stops as soon as the

display is turned off. That is, it will not stay on on the lock screen, only when unlocked. If the phone is stowed (e.g. put in your pocket), it also detects that and doesn't force the display to stay on while it is stowed.

Personally, I set my screen timeout to 15 seconds and enable this feature. This lets me comfortably read anything that I want without the screen timing out and avoids it staying

on too long when unused.

Ambient display

If you have "Ambient Display" enabled in Settings >> Display then:

* the stow sensor and flat up sensor will pulse the display when the phone is picked up

* the IR sensors will pulse the display when you wave your hand over the phone

These can be toggled on or off in Settings >> Gestures >> Ambient display.

Actions

The sensors recognize two gesture:

* The "doorknob" gesture (hold your phone and twist it back and forth a couple of times quickly in a manner similar to twisting a doorknob). By default this will launch the camera.

* The chop-chop gesture (hold on to your phone, tightly, and make two hard karate chopping swings with it). By default this will toggle the torch.

You can customize both of these gestures in Settings >> Gestures >> Actions and you can also configure the amount of haptic feedback for these gestures.

Finally, you can wave your hand over the phone to silence an incoming call. Currently, this functionality only silences calls and not other alarms and notifications.

Camera actions

When the camera is launched by either (or both) of the gestures, different intents are triggered depending on whether or not the phone is locked.

If the phone is unlocked, an intent is sent to start a camera for a still shot. If you have multiple cameras and haven't picked a default for the intent, it will give you the normal app picker and allow you to pick a camera as a default.

If the phone is locked, a different intent is sent to take a still picture in a secure mode. This allows the camera to be used without having to unlock the screen. However, since the screen is still locked, it's not possible to offer an app picker to select the app to use. To make this more usable, the software will try to use the same app as the default app that would have been used if the phone was unlocked. Some apps, though, do not support a secure mode (e.g. snapchat) . If that happens, the system will automatically pick a "best" camera app and there's no way to customize that.

In other words, you can pick the camera app by unlocking the phone and making the gesture and this app wlil then be used (if possible) for both cases.