Skip to content

Commit 26373a9

Browse files
committed
Remove static getNotificationManager with context parameter
1 parent cdc2598 commit 26373a9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,7 @@ public static synchronized UnityNotificationManager getNotificationManagerImpl(A
127127
}
128128

129129
public NotificationManager getNotificationManager() {
130-
return getNotificationManager(mContext);
131-
}
132-
133-
// Get system notification service.
134-
public static NotificationManager getNotificationManager(Context context) {
135-
return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
130+
return (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
136131
}
137132

138133
public void registerNotificationChannel(
@@ -192,7 +187,7 @@ private static String getSharedPrefsNameByChannelId(String id)
192187

193188
public NotificationChannelWrapper getNotificationChannel(String id) {
194189
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
195-
NotificationChannel ch = getNotificationManager(mContext).getNotificationChannel(id);
190+
NotificationChannel ch = getNotificationManagerImpl(mContext).getNotificationManager().getNotificationChannel(id);
196191
if (ch == null)
197192
return null;
198193
return notificationChannelToWrapper(ch);

0 commit comments

Comments
 (0)