Skip to content

Commit fcded87

Browse files
committed
Rename variable
1 parent 888a418 commit fcded87

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

com.unity.mobile.notifications/Runtime/Android/AndroidNotificationCenter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class AndroidNotificationCenter
6666
private static AndroidJavaObject KEY_REPEAT_INTERVAL;
6767
private static AndroidJavaObject KEY_NOTIFICATION;
6868
private static AndroidJavaObject KEY_SMALL_ICON;
69-
private static AndroidJavaObject SHOW_IN_FOREGROUND;
69+
private static AndroidJavaObject KEY_SHOW_IN_FOREGROUND;
7070

7171
/// <summary>
7272
/// Initialize the AndroidNotificationCenter class.
@@ -116,7 +116,7 @@ public static bool Initialize()
116116
KEY_REPEAT_INTERVAL = s_NotificationManagerClass.GetStatic<AndroidJavaObject>("KEY_REPEAT_INTERVAL");
117117
KEY_NOTIFICATION = s_NotificationManagerClass.GetStatic<AndroidJavaObject>("KEY_NOTIFICATION");
118118
KEY_SMALL_ICON = s_NotificationManagerClass.GetStatic<AndroidJavaObject>("KEY_SMALL_ICON");
119-
SHOW_IN_FOREGROUND = s_NotificationManagerClass.GetStatic<AndroidJavaObject>("SHOW_IN_FOREGROUND");
119+
KEY_SHOW_IN_FOREGROUND = s_NotificationManagerClass.GetStatic<AndroidJavaObject>("KEY_SHOW_IN_FOREGROUND");
120120

121121
s_Initialized = true;
122122
#endif
@@ -469,7 +469,7 @@ public static AndroidJavaObject CreateNotificationBuilder(int id, AndroidNotific
469469
extras.Call("putInt", KEY_ID, id);
470470
extras.Call("putLong", KEY_REPEAT_INTERVAL, notification.RepeatInterval.ToLong());
471471
extras.Call("putLong", KEY_FIRE_TIME, fireTime);
472-
extras.Call("putBoolean", SHOW_IN_FOREGROUND, notification.ShowInForeground);
472+
extras.Call("putBoolean", KEY_SHOW_IN_FOREGROUND, notification.ShowInForeground);
473473
if (!string.IsNullOrEmpty(notification.IntentData))
474474
extras.Call("putString", KEY_INTENT_DATA, notification.IntentData);
475475
}
@@ -497,7 +497,7 @@ internal static AndroidNotificationIntentData GetNotificationData(AndroidJavaObj
497497
notification.UsesStopwatch = extras.Call<bool>("getBoolean", Notification_EXTRA_SHOW_CHRONOMETER, false);
498498
notification.FireTime = extras.Call<long>("getLong", KEY_FIRE_TIME, -1L).ToDatetime();
499499
notification.RepeatInterval = extras.Call<long>("getLong", KEY_REPEAT_INTERVAL, -1L).ToTimeSpan();
500-
notification.ShowInForeground = extras.Call<bool>("getBoolean", SHOW_IN_FOREGROUND, true);
500+
notification.ShowInForeground = extras.Call<bool>("getBoolean", KEY_SHOW_IN_FOREGROUND, true);
501501

502502
if (extras.Call<bool>("containsKey", Notification_EXTRA_BIG_TEXT))
503503
notification.Style = NotificationStyle.BigTextStyle;

com.unity.mobile.notifications/Runtime/Android/Plugins/com/unity/androidnotifications/UnityNotificationManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class UnityNotificationManager extends BroadcastReceiver {
6060
protected static final String KEY_NOTIFICATION_ID = "com.unity.NotificationID";
6161
protected static final String KEY_SMALL_ICON = "smallIcon";
6262
protected static final String KEY_CHANNEL_ID = "channelID";
63-
protected static final String SHOW_IN_FOREGROUND = "com.unity.showInForeground";
63+
protected static final String KEY_SHOW_IN_FOREGROUND = "com.unity.showInForeground";
6464

6565
protected static final String NOTIFICATION_CHANNELS_SHARED_PREFS = "UNITY_NOTIFICATIONS";
6666
protected static final String NOTIFICATION_CHANNELS_SHARED_PREFS_KEY = "ChannelIDs";
@@ -681,7 +681,7 @@ public void onReceive(Context context, Intent intent) {
681681

682682
// Call the system notification service to notify the notification.
683683
protected static void notify(Context context, int id, Notification notification) {
684-
boolean showInForeground = notification.extras.getBoolean(SHOW_IN_FOREGROUND, true);
684+
boolean showInForeground = notification.extras.getBoolean(KEY_SHOW_IN_FOREGROUND, true);
685685
if (!isInForeground() || showInForeground) {
686686
getNotificationManager(context).notify(id, notification);
687687
}

com.unity.mobile.notifications/Runtime/Android/Plugins/com/unity/androidnotifications/UnityNotificationUtilities.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import static com.unity.androidnotifications.UnityNotificationManager.KEY_NOTIFICATION;
3030
import static com.unity.androidnotifications.UnityNotificationManager.KEY_REPEAT_INTERVAL;
3131
import static com.unity.androidnotifications.UnityNotificationManager.KEY_SMALL_ICON;
32-
import static com.unity.androidnotifications.UnityNotificationManager.SHOW_IN_FOREGROUND;
32+
import static com.unity.androidnotifications.UnityNotificationManager.KEY_SHOW_IN_FOREGROUND;
3333
import static com.unity.androidnotifications.UnityNotificationManager.TAG_UNITY;
3434

3535
public class UnityNotificationUtilities {
@@ -145,7 +145,7 @@ private static boolean serializeNotificationCustom(Notification notification, Da
145145
out.writeBoolean(notification.extras.getBoolean(Notification.EXTRA_SHOW_CHRONOMETER, false));
146146
out.writeBoolean(showWhen);
147147
serializeString(out, notification.extras.getString(KEY_INTENT_DATA));
148-
out.writeBoolean(notification.extras.getBoolean(SHOW_IN_FOREGROUND, true));
148+
out.writeBoolean(notification.extras.getBoolean(KEY_SHOW_IN_FOREGROUND, true));
149149
}
150150

151151
serializeString(out, Build.VERSION.SDK_INT < Build.VERSION_CODES.O ? null : notification.getChannelId());
@@ -339,7 +339,7 @@ private static Notification.Builder deserializeNotificationCustom(DataInputStrea
339339
builder.getExtras().putLong(KEY_REPEAT_INTERVAL, repeatInterval);
340340
if (intentData != null)
341341
builder.getExtras().putString(KEY_INTENT_DATA, intentData);
342-
builder.getExtras().putBoolean(SHOW_IN_FOREGROUND, showInForeground);
342+
builder.getExtras().putBoolean(KEY_SHOW_IN_FOREGROUND, showInForeground);
343343
}
344344
if (title != null)
345345
builder.setContentTitle(title);

0 commit comments

Comments
 (0)