Fix 'show badge' for pre O apps

Test: make -j RunSettingsRoboTests
Change-Id: I20f6b38986afde0ca781329ffc24326601650a1f
Fixes: 69437269
This commit is contained in:
Julia Reynolds
2018-03-29 15:54:16 -04:00
parent b0a35de10b
commit 6f2450636a
2 changed files with 34 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ package com.android.settings.notification;
import static android.provider.Settings.Secure.NOTIFICATION_BADGING;
import android.app.NotificationChannel;
import android.content.Context;
import android.provider.Settings;
import android.support.v7.preference.Preference;
@@ -55,8 +56,12 @@ public class BadgePreferenceController extends NotificationPreferenceController
NOTIFICATION_BADGING, SYSTEM_WIDE_ON) == SYSTEM_WIDE_OFF) {
return false;
}
if (mChannel != null && !mAppRow.showBadge) {
return false;
if (mChannel != null) {
if (NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) {
return true;
} else {
return mAppRow.showBadge;
}
}
return true;
}