Android: rename isPluginRunning to isNativePluginIntegrationReady
This has been used to notify that the platform integration is setup and ready, now the name is more descriptive of what it does. Task-number: QTBUG-118077 Change-Id: I9fab525f07433f9ec8057e2475a3b1e4658f84d9 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
This commit is contained in:
parent
aea816b197
commit
57330a18ca
@ -208,7 +208,7 @@ public class QtActivityBase extends Activity
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event)
|
||||
{
|
||||
QtNative.ApplicationStateDetails stateDetails = QtNative.getStateDetails();
|
||||
if (!stateDetails.isStarted || !m_delegate.isPluginRunning())
|
||||
if (!stateDetails.isStarted || !stateDetails.nativePluginIntegrationReady)
|
||||
return false;
|
||||
|
||||
return m_delegate.getInputDelegate().onKeyDown(keyCode, event);
|
||||
@ -218,7 +218,7 @@ public class QtActivityBase extends Activity
|
||||
public boolean onKeyUp(int keyCode, KeyEvent event)
|
||||
{
|
||||
QtNative.ApplicationStateDetails stateDetails = QtNative.getStateDetails();
|
||||
if (!stateDetails.isStarted || !m_delegate.isPluginRunning())
|
||||
if (!stateDetails.isStarted || !stateDetails.nativePluginIntegrationReady)
|
||||
return false;
|
||||
|
||||
return m_delegate.getInputDelegate().onKeyUp(keyCode, event);
|
||||
|
@ -37,8 +37,6 @@ public class QtActivityDelegate
|
||||
{
|
||||
private Activity m_activity;
|
||||
|
||||
private boolean m_isPluginRunning = false;
|
||||
|
||||
private HashMap<Integer, QtSurface> m_surfaces = null;
|
||||
private HashMap<Integer, View> m_nativeViews = null;
|
||||
private QtLayout m_layout = null;
|
||||
@ -97,11 +95,6 @@ public class QtActivityDelegate
|
||||
});
|
||||
}
|
||||
|
||||
boolean isPluginRunning()
|
||||
{
|
||||
return m_isPluginRunning;
|
||||
}
|
||||
|
||||
void setContextMenuVisible(boolean contextMenuVisible)
|
||||
{
|
||||
m_contextMenuVisible = contextMenuVisible;
|
||||
@ -300,12 +293,6 @@ public class QtActivityDelegate
|
||||
m_accessibilityDelegate.notifyScrolledEvent(viewId);
|
||||
}
|
||||
|
||||
@UsedFromNativeCode
|
||||
public void notifyQtAndroidPluginRunning(boolean running)
|
||||
{
|
||||
m_isPluginRunning = running;
|
||||
}
|
||||
|
||||
@UsedFromNativeCode
|
||||
public void initializeAccessibility()
|
||||
{
|
||||
|
@ -203,6 +203,7 @@ public class QtNative
|
||||
|
||||
public static class ApplicationStateDetails {
|
||||
int state = ApplicationState.ApplicationSuspended;
|
||||
boolean nativePluginIntegrationReady = false;
|
||||
boolean isStarted = false;
|
||||
}
|
||||
|
||||
@ -216,6 +217,12 @@ public class QtNative
|
||||
m_stateDetails.isStarted = started;
|
||||
}
|
||||
|
||||
@UsedFromNativeCode
|
||||
public static void notifyNativePluginIntegrationReady(boolean ready)
|
||||
{
|
||||
m_stateDetails.nativePluginIntegrationReady = ready;
|
||||
}
|
||||
|
||||
public static void setApplicationState(int state)
|
||||
{
|
||||
synchronized (m_mainActivityMutex) {
|
||||
|
@ -99,6 +99,7 @@ namespace QtAndroid
|
||||
void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration)
|
||||
{
|
||||
m_androidPlatformIntegration = androidPlatformIntegration;
|
||||
QtAndroid::notifyNativePluginIntegrationReady((bool)m_androidPlatformIntegration);
|
||||
|
||||
// flush the pending state if necessary.
|
||||
if (m_androidPlatformIntegration && (m_pendingApplicationState != -1)) {
|
||||
@ -213,9 +214,11 @@ namespace QtAndroid
|
||||
qtActivityDelegate().callMethod<void>("notifyScrolledEvent", accessibilityObjectId);
|
||||
}
|
||||
|
||||
void notifyQtAndroidPluginRunning(bool running)
|
||||
void notifyNativePluginIntegrationReady(bool ready)
|
||||
{
|
||||
qtActivityDelegate().callMethod<void>("notifyQtAndroidPluginRunning", running);
|
||||
QJniObject::callStaticMethod<void>(m_applicationClass,
|
||||
"notifyNativePluginIntegrationReady",
|
||||
ready);
|
||||
}
|
||||
|
||||
jobject createBitmap(QImage img, JNIEnv *env)
|
||||
|
@ -75,7 +75,7 @@ namespace QtAndroid
|
||||
void notifyObjectFocus(uint accessibilityObjectId);
|
||||
void notifyValueChanged(uint accessibilityObjectId, jstring value);
|
||||
void notifyScrolledEvent(uint accessibilityObjectId);
|
||||
void notifyQtAndroidPluginRunning(bool running);
|
||||
void notifyNativePluginIntegrationReady(bool ready);
|
||||
|
||||
const char *classErrorMsgFmt();
|
||||
const char *methodErrorMsgFmt();
|
||||
|
@ -54,7 +54,6 @@ Qt::ScreenOrientation QAndroidPlatformIntegration::m_orientation = Qt::PrimaryOr
|
||||
Qt::ScreenOrientation QAndroidPlatformIntegration::m_nativeOrientation = Qt::PrimaryOrientation;
|
||||
|
||||
bool QAndroidPlatformIntegration::m_showPasswordEnabled = false;
|
||||
static bool m_running = false;
|
||||
|
||||
Q_DECLARE_JNI_CLASS(QtNative, "org/qtproject/qt/android/QtNative")
|
||||
Q_DECLARE_JNI_CLASS(QtDisplayManager, "org/qtproject/qt/android/QtDisplayManager")
|
||||
@ -159,10 +158,6 @@ void QAndroidPlatformNativeInterface::customEvent(QEvent *event)
|
||||
api->accessibility()->setActive(QtAndroidAccessibility::isActive());
|
||||
#endif // QT_CONFIG(accessibility)
|
||||
|
||||
if (!m_running) {
|
||||
m_running = true;
|
||||
QtAndroid::notifyQtAndroidPluginRunning(m_running);
|
||||
}
|
||||
api->flushPendingUpdates();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user