09-26-2012 03:13 PM
Does anybody know if I can check what Application Behaviour the user has selected as in their General settings? (ie. Default, Showcase, or Pause)
I have some custom code managing the powermode when the app is in thumbnail or hidden mode or device on standby, allowing it to keep resource consumption to a minimum while still doing everything it needs to do. But when users have Showcase mode turned on, it doesn't quite work as expected, because I only get the NativeApplication DEACTIVATE event when the device goes into standby, not when other apps come to the forground. (And for some reason QNXSystemEvent.STANDBY never fires at all (no matter which mode), nor do I ever get anything but 'active' from qnxSystem.systemState, even when the device is asleep). So it seems how ever I write it only works correctly in one Default or Showcase, but not in both (I'm not worried about Pause).
My app : Get set - Get up! Get ready for the snooze revolution.
10-01-2012 09:57 AM
The API actually does as it promises, it's just that the system never becomes inactive. The APIs are based on the premise that an app can be active or not, meaning that the user is interacting with that application, but also that the system can be active or not. If the system is active, it is reasonable for an app such as the music app to
continue to play music and perhaps for PIM to provide audible notifications that a new email has arrived. If the system is not active (perhaps it is on the middle of the night or the PlayBook is sitting at home while I'm at work), such actions are unnecessary and possibly undesirable.
The rule is that an app is sent messages for each of its top level window indicating if it should be active or not, a window will be inactive either because it is invisible due to the display being off or the window being off-screen or because the Navigator thinks it should be (this has got to do with the showcase/default/paused) modes. AIR makes the app itself inactive whenever all its windows are inactive. All this works sensibly when there are multiple displays (LCD & HDMI or a dozen of each) and when some may be on and some may be off. It also allows for multiple apps to be active simultaneously which is what occurs today if you have a presentation mode app displaying something on the HDMI and switch on the LCD to another non-presentation mode app. So, given this, having the LCD turn off means nothing except that all windows that are on the LCD are now inactive. It does not imply system standby though it is entirely possible that some components interpret this to mean this (which if so will likely indicate lurking problems). There's no concept of a standby state so AIR's behavior is correct.