Skip to content

Commit 9d76b27

Browse files
committed
rm dead code for Android 6.0 (M)
assignGrouplessNotifications is only ever needed for Android 7.0 (N) and higher so bumped this requirement. Also the Android 6.0 (M) implementation was incomplete, it never assigned anything from the old notification.
1 parent 8e7a758 commit 9d76b27

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignalNotificationManager.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,11 @@ static ArrayList<StatusBarNotification> getActiveGrouplessNotifications(Context
100100
/**
101101
* All groupless notifications are assigned the GROUPLESS_SUMMARY_KEY and notify() is called
102102
*/
103-
@RequiresApi(api = Build.VERSION_CODES.M)
103+
@RequiresApi(api = Build.VERSION_CODES.N)
104104
static void assignGrouplessNotifications(Context context, ArrayList<StatusBarNotification> grouplessNotifs) {
105105
for (StatusBarNotification grouplessNotif : grouplessNotifs) {
106-
Notification.Builder grouplessNotifBuilder;
107-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
108-
grouplessNotifBuilder = Notification.Builder.recoverBuilder(context, grouplessNotif.getNotification());
109-
} else {
110-
grouplessNotifBuilder = new Notification.Builder(context);
111-
}
106+
Notification.Builder grouplessNotifBuilder =
107+
Notification.Builder.recoverBuilder(context, grouplessNotif.getNotification());
112108

113109
// Recreate the notification but with the groupless key instead
114110
Notification notif = grouplessNotifBuilder

0 commit comments

Comments
 (0)