12-27-2012 06:14 AM
I have a problem with run_when_backgrounded flag. It looks like that when an app goes to the thumbnail() or invisible() state the BB10 either clocks the CPU down or limits CPU cycles available for an application.
My app needs a lot of CPU power in background sometimes to perform some realtime sound encoding / decoding. It runs fine when foregrounded, but can't encode enough frames in background or thumbnail.
So, there are, actually, two questions:
1. can I request more processing power in thumbnail() or invisible()?
2. can I request the OS to not to turn the screen off so my app won't go to the invisible() state without user interaction?
12-27-2012 02:03 PM - edited 12-27-2012 02:05 PM
For the second question:
int idleMode = settings->getKeepAwake() ? SCREEN_IDLE_MODE_KEEP_AWAKE : SCREEN_IDLE_MODE_NORMAL; screen_window_t handle = Application::instance()->mainWindow()->handle(); screen_set_window_property_iv(handle, SCREEN_PROPERTY_IDLE_MODE, &idleMode);
Add -lscreen to project file.