summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
diff options
context:
space:
mode:
authorPeter Rustler <peter.rustler@basyskom.com>2015-02-10 13:31:24 +0100
committerPeter Rustler <peter.rustler@basyskom.com>2015-03-17 09:09:46 +0000
commit88e448a90b9aa7dbbfb0737c1c6330cc3433c67e (patch)
treee67d1348f9117e136d32df37188ed1e8eade72a0 /src/plugins/platforms/android
parent3d8c86881c7c57f646819e825c7c48f2b27bbfcc (diff)
Added new private API for Android and onPause/onResume
On Android the foreground activity can get onPause/onResume calls. In Nfc code in android we need to know if we are paused or resumed. And we need to make sure to call disableForegroundDispatch inside the onPause call and in the main Ui thread. The current implementiton of applicationStateChanged was not sufficient to acomplish that. This patch adds a way to receive those onPause/onResume calls in Qt with proper timing. Change-Id: I3a8cec093fc02ec42cc8677dfe2d0d4f8a227f8b Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index a18e9dac5f..b30aab5b11 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -594,6 +594,11 @@ static void updateApplicationState(JNIEnv */*env*/, jobject /*thiz*/, jint state
return;
}
+ if (state == Qt::ApplicationActive)
+ QtAndroidPrivate::handleResume();
+ else if (state == Qt::ApplicationInactive)
+ QtAndroidPrivate::handlePause();
+
if (state <= Qt::ApplicationInactive) {
// Don't send timers and sockets events anymore if we are going to hide all windows
QAndroidEventDispatcherStopper::instance()->goingToStop(true);