Add a method to detect Google Play build

This commit is contained in:
albexk 2024-09-17 20:52:31 +03:00
parent 582bd92d31
commit e2dd5109f9
3 changed files with 9 additions and 0 deletions

View file

@ -708,6 +708,9 @@ class AmneziaActivity : QtActivity() {
}
}
@Suppress("unused")
fun isPlay(): Boolean = BuildConfig.FLAVOR == "play"
/**
* Utils methods
*/

View file

@ -287,6 +287,11 @@ bool AndroidController::requestAuthentication()
return result;
}
bool AndroidController::isPlay()
{
return callActivityMethod<jboolean>("isPlay", "()Z");
}
// Moving log processing to the Android side
jclass AndroidController::log;
jmethodID AndroidController::logDebug;

View file

@ -48,6 +48,7 @@ public:
bool isNotificationPermissionGranted();
void requestNotificationPermission();
bool requestAuthentication();
bool isPlay();
static bool initLogging();
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message);