Hi Guys
This might be usual info for some of you...
I was investigating the wakelocks for some of my busier apps - in the region of 2 - 3% of sessions have stuck wakelocks - Google bad behaviour allows for 0.10% so it's a problem and Google said it would affect store visibility if not addressed.
The main tag that seems to be the culprit is Audiomix (so sound and music) - possibly related to users switching jumping in and out of apps or due to adverts.
In order to try and fix this I modified some of the SDL Java file slightly...to perform a release of sound resources before native pause - and so far, it seems to be reducing my wakelocks!! Yay!!
My test app was 2.10% wakelock and is now down to 1.49% and that is with only a small portion of the total installs on the new version...If it gets down even further I will let you know.
public void surfaceDestroyed(SurfaceHolder holder) {
Log.i("glbasic", "surfaceDestroyed()");
if (SDLActivity.usePauseCall==true)
SDLActivity.glbasicOnPause(1); // 1=pause
if (!SDLActivity.mIsPaused) {
SDLActivity.mIsPaused = true;
SDLActivity.androidAudio.pauseMusic(); // gp
SDLActivity.androidAudio.release(); // gp - releasing sound resources
SDLActivity.nativePause(); // SDL2 - moved down in sequence
}
enableSensor(Sensor.TYPE_ACCELEROMETER, false);
}