Notification channel settings updates

- Show a deleted count instead of individual deleted channels
- Make the link to app settings more prominent
- Reload settings onresume

Change-Id: I4f493181194943310ba536eb2bca270cec7cafce
Fixes: 36119790
Fixes: 36191444
Test: manual
This commit is contained in:
Julia Reynolds
2017-03-15 11:32:54 -04:00
parent 2194f3db37
commit 8973e2786d
6 changed files with 136 additions and 129 deletions

View File

@@ -127,15 +127,6 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
}
mUserId = UserHandle.getUserId(mUid);
mAppRow = mBackend.loadAppRow(mContext, mPm, mPkgInfo);
mChannel = (args != null && args.containsKey(Settings.EXTRA_CHANNEL_ID)) ?
mBackend.getChannel(mPkg, mUid, args.getString(Settings.EXTRA_CHANNEL_ID)) : null;
mSuspendedAppsAdmin = RestrictedLockUtils.checkIfApplicationIsSuspended(
mContext, mPkg, mUserId);
NotificationManager.Policy policy =
NotificationManager.from(mContext).getNotificationPolicy();
mDndVisualEffectsSuppressed = policy == null ? false : policy.suppressedVisualEffects != 0;
}
@Override
@@ -146,12 +137,19 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
finish();
return;
}
mAppRow = mBackend.loadAppRow(mContext, mPm, mPkgInfo);
Bundle args = getArguments();
mChannel = (args != null && args.containsKey(Settings.EXTRA_CHANNEL_ID)) ?
mBackend.getChannel(mPkg, mUid, args.getString(Settings.EXTRA_CHANNEL_ID)) : null;
mSuspendedAppsAdmin = RestrictedLockUtils.checkIfApplicationIsSuspended(
mContext, mPkg, mUserId);
NotificationManager.Policy policy =
NotificationManager.from(mContext).getNotificationPolicy();
mDndVisualEffectsSuppressed = policy == null ? false : policy.suppressedVisualEffects != 0;
mSuspendedAppsAdmin = RestrictedLockUtils.checkIfApplicationIsSuspended(
mContext, mPkg, mUserId);
if (mBlock.isEnabled()) {
mBlock.setDisabledByAdmin(mSuspendedAppsAdmin);
}
mBadge.setDisabledByAdmin(mSuspendedAppsAdmin);
}
protected void setVisible(Preference p, boolean visible) {