Merge "Add null check for notification preference helper" into tm-dev am: d7032e596f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17252611

Change-Id: I635dcaa774e7a5cdd90ac9bd9d6ea587d2025048
This commit is contained in:
Kazuki Takise
2022-03-20 03:41:58 +00:00
committed by Automerger Merge Worker

View File

@@ -601,8 +601,10 @@ public class PreferencesHelper implements RankingConfig {
out.attribute(null, ATT_NAME, r.pkg);
if (!notifPermissions.isEmpty()) {
Pair<Integer, String> app = new Pair(r.uid, r.pkg);
final Pair<Boolean, Boolean> permission = notifPermissions.get(app);
out.attributeInt(null, ATT_IMPORTANCE,
notifPermissions.get(app).first ? IMPORTANCE_DEFAULT : IMPORTANCE_NONE);
permission != null && permission.first ? IMPORTANCE_DEFAULT
: IMPORTANCE_NONE);
notifPermissions.remove(app);
} else {
if (r.importance != DEFAULT_IMPORTANCE) {