Add a method to detect Google Play build

This commit is contained in:
albexk
2024-09-17 20:52:31 +03:00
committed by NickVs2015
parent 1d345dfde2
commit 8c9f91328b
3 changed files with 11 additions and 0 deletions
@@ -1163,6 +1163,9 @@ class AmneziaActivity : QtActivity() {
return super.dispatchTrackballEvent(ev)
}
@Suppress("unused")
fun isPlay(): Boolean = BuildConfig.FLAVOR == "play"
/**
* Utils methods
*/
@@ -328,6 +328,13 @@ void AndroidController::sendTouch(float x, float y)
callActivityMethod("sendTouch", "(FF)V", x, y);
}
bool AndroidController::isPlay()
{
return callActivityMethod<jboolean>("isPlay", "()Z");
}
// Moving log processing to the Android side
jclass AndroidController::log;
jmethodID AndroidController::logDebug;
@@ -55,6 +55,7 @@ public:
void requestNotificationPermission();
bool requestAuthentication();
void sendTouch(float x, float y);
bool isPlay();
static bool initLogging();
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message);