From cf18c3c2d14b54896e51fec829ae2d89642a59eb Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 1 Mar 2017 12:04:25 -0800 Subject: [PATCH] Only check for badge setting on notification on O+ Bug: 33553066 Change-Id: I20b991ae23c92c81510986191c05426ea72d273b --- .../launcher3/notification/NotificationListener.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/notification/NotificationListener.java b/src/com/android/launcher3/notification/NotificationListener.java index 9b881548a7..d9f7d7634c 100644 --- a/src/com/android/launcher3/notification/NotificationListener.java +++ b/src/com/android/launcher3/notification/NotificationListener.java @@ -26,6 +26,7 @@ import android.support.annotation.Nullable; import android.support.v4.util.Pair; import com.android.launcher3.LauncherModel; +import com.android.launcher3.Utilities; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.util.PackageUserKey; @@ -214,9 +215,11 @@ public class NotificationListener extends NotificationListenerService { } private boolean shouldBeFilteredOut(StatusBarNotification sbn) { - getCurrentRanking().getRanking(sbn.getKey(), mTempRanking); - if (!mTempRanking.canShowBadge()) { - return true; + if (Utilities.isAtLeastO()) { + getCurrentRanking().getRanking(sbn.getKey(), mTempRanking); + if (!mTempRanking.canShowBadge()) { + return true; + } } Notification notification = sbn.getNotification(); boolean isGroupHeader = (notification.flags & Notification.FLAG_GROUP_SUMMARY) != 0;