Question

When I touch the SmartWatch screen it wakes up from dimmed state. How can I in code do the same thing?

Was it helpful?

Solution

Refer to section 6.2 of the "SmartExtension API Specification" document that comes with the SmartExtension SDK:

Extensions implementing the Control API also have the possibility to control the state of the accessory display. The display can be controlled via the CONTROL_SET_SCREEN_STATE_INTENT.

As part of the Intent, you also need to specify what state you want to set. The following options are available:
* SCREEN_STATE_OFF
* SCREEN_STATE_DIM
* SCREEN_STATE_ON
* SCREEN_STATE_AUTO

OTHER TIPS

What Michael says is correct, and is also said in this thread (as you know :). When you set the screen state to AUTO, the screen state will be handled by the SmartWatch itself. In this state, when the screen has been completely dimmed, you will not get touch events to your extension. Instead you will get a call to onResume.

So, to achieve what you want, I think you need to create a state machine that handles the states ON, OFF and DIM, and leave AUTO out of it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top