Is it possible to refresh the screen to stay on longer

Is there a way in onEnterSleep or onHide to temporarily keep the display alive?

And conversely is there a way to programmatically blank the display when it's no longer needed.

  • On MIP devices, the watch face stays on after onEnterSleep is called.  On AMOLED devices, you need to use care for Always On Display when onEnterSleep is call.  The general rule is no more than 10% of the pixels can be on at one time, and that no single pixel can be on for more than 3 minutes.(the 3 minute rules may not be used for some devices).  This is to help prevent burn-in.

    For my WFs and AMOLED screens, I typically reduce what I show after onEnterSleep was called (just the time for example to stay under the 10%). and move it around (to stay under the 3 minute limit).  I show the time all the time, and the full WF after a gesture and onExitSleep was called (for about 10 seconds)

  • I'm not looking to keep the screen on, just to wake it again or make it sleep.

  • If you want the screen blank just set the colors, do a dc.clear() and don't  draw anything..

  • I probably wasn't clear in what is needed.

    The watch display has a timeout, how can you simulate the exact same change, on demand, and how can you reverse the process once a manual or display timeout has happened, how can you get the screen to come back on / wake?

  • 1)  is there a way to dynamically control the built in display Timeout? Such as refresh it so that the Timeout does not occur till the app decides it's ok? [Without making the watch app background, or other special permissions]

    2) The default short Timeout is about 5 seconds, is there a way to extend it temporarily to 60-120 seconds 

    3) can an App switch Always On on for a minute and then turn it off again?

    4) when there has been no interaction on the app for a while how do you program closing it to return to the watch face?

  • The only way to change these things is if the user changes them in the watch settings. 

    With a widget, if there's no user interaction in 1-2 minutes (depends on the device), the widget will close and return to the watch face.  You can do the same thing in a device app by using your own Timer to track how long it's been since the last user interaction and then use System.exit(), but on some devices that may only take you back to the activity loop.

  • Thanks, Is there no way to simulate user interaction from the program? [thus keeping the display alive]

  • In the sim, widgets don't time out.  And device apps won't unless you include your own logic.  So neither will time out.

    With watch faces in the sim, you must change between high and low power for things to behave differently.

  • If you're developing an app or widget, this might be what you're looking for: 

    if(Attention has :backlight) {
    	try{
    		Attention.backlight(true);
    	} catch (exception) {
    		// Sometimes this doesn't work.
    	}
    }
    I think AMOLED devices sometimes won't let you force the backlight on for longer than a certain amount of time, thus the try statement tries to prevent that exception from crashing the app.
  • Correct.  If you check the API doc for Attention.backlight() it says

    "..but if the product has burn in protection an exception will be thrown if you attempt to keep the display enabled for too long (e.g. over 1 minute)"