Skip to content

Commit a616e61

Browse files
committed
Make getNotificationOrBuilderForIntent private instance method
1 parent a5c2f85 commit a616e61

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ public void onReceive(Intent intent) {
660660
return;
661661
}
662662
}
663-
Object notification = getNotificationOrBuilderForIntent(mContext, intent);
663+
Object notification = getNotificationOrBuilderForIntent(intent);
664664
if (notification != null) {
665665
Notification notif = null;
666666
int id = -1;
@@ -853,7 +853,7 @@ public Notification getNotificationFromIntent(Intent intent) {
853853
}
854854
}
855855

856-
Object notification = getNotificationOrBuilderForIntent(mContext, intent);
856+
Object notification = getNotificationOrBuilderForIntent(intent);
857857
if (notification == null)
858858
return null;
859859
if (notification instanceof Notification)
@@ -862,7 +862,7 @@ public Notification getNotificationFromIntent(Intent intent) {
862862
return builder.build();
863863
}
864864

865-
public static Object getNotificationOrBuilderForIntent(Context context, Intent intent) {
865+
private Object getNotificationOrBuilderForIntent(Intent intent) {
866866
Object notification = null;
867867
boolean sendable = false;
868868
if (intent.hasExtra(KEY_NOTIFICATION_ID)) {
@@ -872,8 +872,8 @@ public static Object getNotificationOrBuilderForIntent(Context context, Intent i
872872
sendable = true;
873873
} else {
874874
// in case we don't have cached notification, deserialize from storage
875-
SharedPreferences prefs = context.getSharedPreferences(getSharedPrefsNameByNotificationId(String.valueOf(id)), Context.MODE_PRIVATE);
876-
notification = UnityNotificationUtilities.deserializeNotification(context, prefs);
875+
SharedPreferences prefs = mContext.getSharedPreferences(getSharedPrefsNameByNotificationId(String.valueOf(id)), Context.MODE_PRIVATE);
876+
notification = UnityNotificationUtilities.deserializeNotification(mContext, prefs);
877877
}
878878
} else if (intent.hasExtra(KEY_NOTIFICATION)) {
879879
// old code path where Notification object is in intent
@@ -887,7 +887,7 @@ public static Object getNotificationOrBuilderForIntent(Context context, Intent i
887887

888888
Notification.Builder builder;
889889
if (notification instanceof Notification) {
890-
builder = UnityNotificationUtilities.recoverBuilder(context, (Notification)notification);
890+
builder = UnityNotificationUtilities.recoverBuilder(mContext, (Notification)notification);
891891
}
892892
else {
893893
builder = (Notification.Builder)notification;

0 commit comments

Comments
 (0)