1

I want to disable the back action key when my smart extension is in Power Save Mode, that means the display is dimmed after several seconds but the control extension remains on. When it is not in Power Save Mode the back action key should work again.

I tried to figure out how to check the current POWER SAVE MODE, but couldn't manage it. When the control switches to Power Save Mode LogCat says:

onReceive: com.sonyericsson.extras.aef.control.ACTIVE_POWER_SAVE_MODE_STATUS_CHANGED

The API also says that there are following allowed values: ACTIVE_POWER_SAVE_MODE_OFF and ACTIVE_POWER_SAVE_MODE_ON

Does anyone know how to check the current Power Save Mode state?

I would then check the current display state in onKey()-method and decide whether back action key should react or not.

Many thanks in advance.

Maxim Makhun
  • 2,197
  • 1
  • 22
  • 26
alex567
  • 13
  • 2

1 Answers1

0

The way I would suggest to achieve what are you trying to do is to register to listen for the CONTROL_ACTIVE_POWER_SAVE_MODE_STATUS_CHANGED_INTENT. When you receive that it will tell you the current status of the active power save mode. Save this to a member variable in your extension and check that to disable/enable the back key.

http://developer.sonymobile.com/reference/sony-addon-sdk/com/sonyericsson/extras/liveware/aef/control/Control.Intents#CONTROL_ACTIVE_POWER_SAVE_MODE_STATUS_CHANGED_INTENT

mldeveloper
  • 2,253
  • 1
  • 13
  • 14
  • Thank You, i did it like you said by saving the current status each time the power save mode had changed. For anyone who is further interested i now also found the method `onActiveLowPowerModeChange(boolean lowPowerModeOn)`. Just override it in your Control class and it will be called everytime the Power Save Mode has changed. – alex567 Jan 20 '14 at 21:35