From bd86eb667efc20413d636f977f1d8b8a85306ad7 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 27 Jan 2021 14:09:33 +0000 Subject: [PATCH] Android: Fixed compile error when push notifications are disabled --- .../native/juce_android_Windowing.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index 42dde15658..67294b177b 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -1668,24 +1668,22 @@ const int KeyPress::fastForwardKey = extendedKeyModifier + 47; const int KeyPress::rewindKey = extendedKeyModifier + 48; //============================================================================== -struct JuceActivityNewIntentListener -{ - #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \ - CALLBACK (appNewIntent, "appNewIntent", "(Landroid/content/Intent;)V") +#ifdef JUCE_PUSH_NOTIFICATIONS_ACTIVITY + struct JuceActivityNewIntentListener + { + #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \ + CALLBACK (appNewIntent, "appNewIntent", "(Landroid/content/Intent;)V") - DECLARE_JNI_CLASS (JavaActivity, JUCE_PUSH_NOTIFICATIONS_ACTIVITY) - #undef JNI_CLASS_MEMBERS + DECLARE_JNI_CLASS (JavaActivity, JUCE_PUSH_NOTIFICATIONS_ACTIVITY) + #undef JNI_CLASS_MEMBERS - static void JNICALL appNewIntent (JNIEnv*, jobject /*activity*/, jobject intentData) - { - #if JUCE_PUSH_NOTIFICATIONS && JUCE_MODULE_AVAILABLE_juce_gui_extra - juce_handleNotificationIntent (static_cast (intentData)); - #else - juce::ignoreUnused (intentData); - #endif - } -}; + static void JNICALL appNewIntent (JNIEnv*, jobject /*activity*/, jobject intentData) + { + juce_handleNotificationIntent (static_cast (intentData)); + } + }; -JuceActivityNewIntentListener::JavaActivity_Class JuceActivityNewIntentListener::JavaActivity; + JuceActivityNewIntentListener::JavaActivity_Class JuceActivityNewIntentListener::JavaActivity; +#endif } // namespace juce