From b883284a1f801f39166b69a913249233490bdc8b Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 4 Jun 2020 09:08:43 +0100 Subject: [PATCH] Android: Fixed inverted screensaver logic --- modules/juce_gui_basics/native/juce_android_Windowing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index 4e08a00868..86800b6ede 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -1289,7 +1289,7 @@ int JUCE_CALLTYPE NativeMessageBox::showYesNoBox (AlertWindow::AlertIconType /*i } //============================================================================== -static bool androidScreenSaverEnabled = false; +static bool androidScreenSaverEnabled = true; void Desktop::setScreenSaverEnabled (bool shouldEnable) { @@ -1304,7 +1304,7 @@ void Desktop::setScreenSaverEnabled (bool shouldEnable) auto* env = getEnv(); LocalRef mainWindow (env->CallObjectMethod (activity.get(), AndroidActivity.getWindow)); - env->CallVoidMethod(mainWindow.get(), AndroidWindow.setFlags, shouldEnable ? FLAG_KEEP_SCREEN_ON : 0, FLAG_KEEP_SCREEN_ON); + env->CallVoidMethod (mainWindow.get(), AndroidWindow.setFlags, shouldEnable ? 0 : FLAG_KEEP_SCREEN_ON, FLAG_KEEP_SCREEN_ON); } androidScreenSaverEnabled = shouldEnable;