Loading res/values/strings.xml +14 −8 Original line number Diff line number Diff line Loading @@ -6454,13 +6454,16 @@ <string name="notifications_enabled">Normal</string> <!-- App notification summary with notifications disabled [CHAR LIMIT=40] --> <string name="notifications_disabled">Blocked</string> <!-- App notification summary with notifications disabled [CHAR LIMIT=40] --> <!-- App notification summary with notifications silenced [CHAR LIMIT=40] --> <string name="notifications_silenced">Silenced</string> <!-- App notification summary with 2 items [CHAR LIMIT=15] --> <string name="notifications_two_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g></string> <!-- App notification summary with 3 items [CHAR LIMIT=15] --> <string name="notifications_three_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%3$s</xliff:g></string> <!-- App notification summary with notifications redacted [CHAR LIMIT=70] --> <string name="notifications_redacted">Sensitive content not on lock screen</string> <!-- App notification summary with notifications hidden [CHAR LIMIT=40] --> <string name="notifications_hidden">Not on lock screen</string> <!-- App notification summary with notifications bypassing DND [CHAR LIMIT=40] --> <string name="notifications_priority">Do Not Disturb overridden</string> <!-- App notification summary divider [CHAR LIMIT=40] --> <string name="notifications_summary_divider">\u00A0/\u00A0</string> <!-- Permissions preference summary [CHAR LIMIT=40] --> <plurals name="permissions_summary"> Loading Loading @@ -6500,7 +6503,7 @@ <string name="filter_with_domain_urls_apps">With domain URLs</string> <!-- Label for showing apps with priority notifications in list [CHAR LIMIT=30] --> <string name="filter_notif_priority_apps">Overrides Do Not Disturb</string> <!-- Label for showing apps redacting sensitive notifications in list [CHAR LIMIT=30] --> <!-- Label for showing apps redacting sensitive notifications in list [CHAR LIMIT=50] --> <string name="filter_notif_sensitive_apps">No sensitive content on lock screen</string> <!-- Label for showing apps hiding notifications from lockscreen [CHAR LIMIT=30] --> <string name="filter_notif_hide_notifications_apps">Never shown on lock screen</string> Loading Loading @@ -7017,7 +7020,10 @@ <string name="data_usage_summary_format"><xliff:g id="amount" example="50%">%1$s</xliff:g> of data used</string> <!-- Summary of notifications [CHAR LIMIT=NONE] --> <string name="notification_summary"><xliff:g id="count" example="24">%1$d</xliff:g> apps blocked from sending</string> <plurals name="notification_summary"> <item quantity="one"><xliff:g id="count" example="1">%d</xliff:g> app blocked from sending</item> <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps blocked from sending</item> </plurals> <!-- Summary of notifications when no apps are blocked [CHAR LIMIT=NONE] --> <string name="notification_summary_none">All apps allowed to send</string> src/com/android/settings/applications/AppStateNotificationBridge.java +11 −6 Original line number Diff line number Diff line Loading @@ -16,9 +16,12 @@ package com.android.settings.applications; import android.app.Notification; import android.content.Context; import android.content.pm.PackageManager; import android.os.UserHandle; import android.service.notification.NotificationListenerService; import com.android.internal.widget.LockPatternUtils; import com.android.settings.notification.NotificationBackend; import com.android.settings.notification.NotificationBackend.AppRow; import com.android.settingslib.applications.ApplicationsState; Loading @@ -35,11 +38,13 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { private final NotificationBackend mNotifBackend; private final PackageManager mPm; private final Context mContext; public AppStateNotificationBridge(PackageManager pm, ApplicationsState appState, public AppStateNotificationBridge(Context context, ApplicationsState appState, Callback callback, NotificationBackend notifBackend) { super(appState, callback); mPm = pm; mContext = context; mPm = mContext.getPackageManager(); mNotifBackend = notifBackend; } Loading @@ -49,13 +54,13 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { final int N = apps.size(); for (int i = 0; i < N; i++) { AppEntry app = apps.get(i); app.extraInfo = mNotifBackend.loadAppRow(mPm, app.info); app.extraInfo = mNotifBackend.loadAppRow(mContext, mPm, app.info); } } @Override protected void updateExtraInfo(AppEntry app, String pkg, int uid) { app.extraInfo = mNotifBackend.loadAppRow(mPm, app.info); app.extraInfo = mNotifBackend.loadAppRow(mContext, mPm, app.info); } public static final AppFilter FILTER_APP_NOTIFICATION_BLOCKED = new AppFilter() { Loading Loading @@ -107,7 +112,7 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { @Override public boolean filterApp(AppEntry info) { return info.extraInfo != null return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure && ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_PRIVATE; } }; Loading @@ -119,7 +124,7 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { @Override public boolean filterApp(AppEntry info) { return info.extraInfo != null return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure && ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_SECRET; } }; Loading src/com/android/settings/applications/InstalledAppDetails.java +27 −4 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; import android.app.LoaderManager.LoaderCallbacks; import android.app.Notification; import android.app.admin.DevicePolicyManager; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; Loading Loading @@ -73,6 +74,7 @@ import android.widget.TextView; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.internal.os.BatterySipper; import com.android.internal.os.BatteryStatsHelper; import com.android.internal.widget.LockPatternUtils; import com.android.settings.AppHeader; import com.android.settings.DeviceAdminAdd; import com.android.settings.R; Loading Loading @@ -1001,18 +1003,39 @@ public class InstalledAppDetails extends AppInfoBase public static CharSequence getNotificationSummary(AppEntry appEntry, Context context, NotificationBackend backend) { AppRow appRow = backend.loadAppRow(context.getPackageManager(), appEntry.info); AppRow appRow = backend.loadAppRow(context, context.getPackageManager(), appEntry.info); return getNotificationSummary(appRow, context); } public static CharSequence getNotificationSummary(AppRow appRow, Context context) { List<String> summaryAttributes = new ArrayList<>(); StringBuffer summary = new StringBuffer(); if (appRow.banned) { return context.getString(R.string.notifications_disabled); summaryAttributes.add(context.getString(R.string.notifications_disabled)); } else if (appRow.appImportance > NotificationListenerService.Ranking.IMPORTANCE_NONE && appRow.appImportance < NotificationListenerService.Ranking.IMPORTANCE_DEFAULT) { return context.getString(R.string.notifications_silenced); summaryAttributes.add(context.getString(R.string.notifications_silenced)); } return ""; final boolean lockscreenSecure = new LockPatternUtils(context).isSecure( UserHandle.myUserId()); if (lockscreenSecure) { if (appRow.appVisOverride == Notification.VISIBILITY_PRIVATE) { summaryAttributes.add(context.getString(R.string.notifications_redacted)); } else if (appRow.appVisOverride == Notification.VISIBILITY_SECRET) { summaryAttributes.add(context.getString(R.string.notifications_hidden)); } } if (appRow.appBypassDnd) { summaryAttributes.add(context.getString(R.string.notifications_priority)); } final int N = summaryAttributes.size(); for (int i = 0; i < N; i++) { if (i > 0) { summary.append(context.getString(R.string.notifications_summary_divider)); } summary.append(summaryAttributes.get(i)); } return summary.toString(); } private class MemoryUpdater extends AsyncTask<Void, Void, ProcStatsPackageEntry> { Loading src/com/android/settings/applications/ManageApplications.java +2 −2 Original line number Diff line number Diff line Loading @@ -788,8 +788,8 @@ public class ManageApplications extends InstrumentedFragment mPm = mContext.getPackageManager(); mFilterMode = filterMode; if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) { mExtraInfoBridge = new AppStateNotificationBridge(mContext.getPackageManager(), mState, this, manageApplications.mNotifBackend); mExtraInfoBridge = new AppStateNotificationBridge(mContext, mState, this, manageApplications.mNotifBackend); } else if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) { mExtraInfoBridge = new AppStateUsageBridge(mContext, mState, this); } else if (mManageApplications.mListType == LIST_TYPE_HIGH_POWER) { Loading src/com/android/settings/applications/NotificationApps.java +3 −3 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class NotificationApps extends ManageApplications { ApplicationsState.getInstance((Application) context.getApplicationContext()); mSession = mAppState.newSession(this); mNotifBackend = new NotificationBackend(); mExtraInfoBridge = new AppStateNotificationBridge(mContext.getPackageManager(), mExtraInfoBridge = new AppStateNotificationBridge(mContext, mAppState, this, mNotifBackend); } Loading @@ -72,8 +72,8 @@ public class NotificationApps extends ManageApplications { if (apps.size() == 0) { mLoader.setSummary(this, mContext.getString(R.string.notification_summary_none)); } else { mLoader.setSummary(this, mContext.getString(R.string.notification_summary, apps.size())); mLoader.setSummary(this, mContext.getResources().getQuantityString( R.plurals.notification_summary, apps.size(), apps.size())); } } Loading Loading
res/values/strings.xml +14 −8 Original line number Diff line number Diff line Loading @@ -6454,13 +6454,16 @@ <string name="notifications_enabled">Normal</string> <!-- App notification summary with notifications disabled [CHAR LIMIT=40] --> <string name="notifications_disabled">Blocked</string> <!-- App notification summary with notifications disabled [CHAR LIMIT=40] --> <!-- App notification summary with notifications silenced [CHAR LIMIT=40] --> <string name="notifications_silenced">Silenced</string> <!-- App notification summary with 2 items [CHAR LIMIT=15] --> <string name="notifications_two_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g></string> <!-- App notification summary with 3 items [CHAR LIMIT=15] --> <string name="notifications_three_items"><xliff:g id="notif_state" example="Priority">%1$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%2$s</xliff:g> / <xliff:g id="notif_state" example="Priority">%3$s</xliff:g></string> <!-- App notification summary with notifications redacted [CHAR LIMIT=70] --> <string name="notifications_redacted">Sensitive content not on lock screen</string> <!-- App notification summary with notifications hidden [CHAR LIMIT=40] --> <string name="notifications_hidden">Not on lock screen</string> <!-- App notification summary with notifications bypassing DND [CHAR LIMIT=40] --> <string name="notifications_priority">Do Not Disturb overridden</string> <!-- App notification summary divider [CHAR LIMIT=40] --> <string name="notifications_summary_divider">\u00A0/\u00A0</string> <!-- Permissions preference summary [CHAR LIMIT=40] --> <plurals name="permissions_summary"> Loading Loading @@ -6500,7 +6503,7 @@ <string name="filter_with_domain_urls_apps">With domain URLs</string> <!-- Label for showing apps with priority notifications in list [CHAR LIMIT=30] --> <string name="filter_notif_priority_apps">Overrides Do Not Disturb</string> <!-- Label for showing apps redacting sensitive notifications in list [CHAR LIMIT=30] --> <!-- Label for showing apps redacting sensitive notifications in list [CHAR LIMIT=50] --> <string name="filter_notif_sensitive_apps">No sensitive content on lock screen</string> <!-- Label for showing apps hiding notifications from lockscreen [CHAR LIMIT=30] --> <string name="filter_notif_hide_notifications_apps">Never shown on lock screen</string> Loading Loading @@ -7017,7 +7020,10 @@ <string name="data_usage_summary_format"><xliff:g id="amount" example="50%">%1$s</xliff:g> of data used</string> <!-- Summary of notifications [CHAR LIMIT=NONE] --> <string name="notification_summary"><xliff:g id="count" example="24">%1$d</xliff:g> apps blocked from sending</string> <plurals name="notification_summary"> <item quantity="one"><xliff:g id="count" example="1">%d</xliff:g> app blocked from sending</item> <item quantity="other"><xliff:g id="count" example="10">%d</xliff:g> apps blocked from sending</item> </plurals> <!-- Summary of notifications when no apps are blocked [CHAR LIMIT=NONE] --> <string name="notification_summary_none">All apps allowed to send</string>
src/com/android/settings/applications/AppStateNotificationBridge.java +11 −6 Original line number Diff line number Diff line Loading @@ -16,9 +16,12 @@ package com.android.settings.applications; import android.app.Notification; import android.content.Context; import android.content.pm.PackageManager; import android.os.UserHandle; import android.service.notification.NotificationListenerService; import com.android.internal.widget.LockPatternUtils; import com.android.settings.notification.NotificationBackend; import com.android.settings.notification.NotificationBackend.AppRow; import com.android.settingslib.applications.ApplicationsState; Loading @@ -35,11 +38,13 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { private final NotificationBackend mNotifBackend; private final PackageManager mPm; private final Context mContext; public AppStateNotificationBridge(PackageManager pm, ApplicationsState appState, public AppStateNotificationBridge(Context context, ApplicationsState appState, Callback callback, NotificationBackend notifBackend) { super(appState, callback); mPm = pm; mContext = context; mPm = mContext.getPackageManager(); mNotifBackend = notifBackend; } Loading @@ -49,13 +54,13 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { final int N = apps.size(); for (int i = 0; i < N; i++) { AppEntry app = apps.get(i); app.extraInfo = mNotifBackend.loadAppRow(mPm, app.info); app.extraInfo = mNotifBackend.loadAppRow(mContext, mPm, app.info); } } @Override protected void updateExtraInfo(AppEntry app, String pkg, int uid) { app.extraInfo = mNotifBackend.loadAppRow(mPm, app.info); app.extraInfo = mNotifBackend.loadAppRow(mContext, mPm, app.info); } public static final AppFilter FILTER_APP_NOTIFICATION_BLOCKED = new AppFilter() { Loading Loading @@ -107,7 +112,7 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { @Override public boolean filterApp(AppEntry info) { return info.extraInfo != null return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure && ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_PRIVATE; } }; Loading @@ -119,7 +124,7 @@ public class AppStateNotificationBridge extends AppStateBaseBridge { @Override public boolean filterApp(AppEntry info) { return info.extraInfo != null return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure && ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_SECRET; } }; Loading
src/com/android/settings/applications/InstalledAppDetails.java +27 −4 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; import android.app.LoaderManager.LoaderCallbacks; import android.app.Notification; import android.app.admin.DevicePolicyManager; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; Loading Loading @@ -73,6 +74,7 @@ import android.widget.TextView; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.internal.os.BatterySipper; import com.android.internal.os.BatteryStatsHelper; import com.android.internal.widget.LockPatternUtils; import com.android.settings.AppHeader; import com.android.settings.DeviceAdminAdd; import com.android.settings.R; Loading Loading @@ -1001,18 +1003,39 @@ public class InstalledAppDetails extends AppInfoBase public static CharSequence getNotificationSummary(AppEntry appEntry, Context context, NotificationBackend backend) { AppRow appRow = backend.loadAppRow(context.getPackageManager(), appEntry.info); AppRow appRow = backend.loadAppRow(context, context.getPackageManager(), appEntry.info); return getNotificationSummary(appRow, context); } public static CharSequence getNotificationSummary(AppRow appRow, Context context) { List<String> summaryAttributes = new ArrayList<>(); StringBuffer summary = new StringBuffer(); if (appRow.banned) { return context.getString(R.string.notifications_disabled); summaryAttributes.add(context.getString(R.string.notifications_disabled)); } else if (appRow.appImportance > NotificationListenerService.Ranking.IMPORTANCE_NONE && appRow.appImportance < NotificationListenerService.Ranking.IMPORTANCE_DEFAULT) { return context.getString(R.string.notifications_silenced); summaryAttributes.add(context.getString(R.string.notifications_silenced)); } return ""; final boolean lockscreenSecure = new LockPatternUtils(context).isSecure( UserHandle.myUserId()); if (lockscreenSecure) { if (appRow.appVisOverride == Notification.VISIBILITY_PRIVATE) { summaryAttributes.add(context.getString(R.string.notifications_redacted)); } else if (appRow.appVisOverride == Notification.VISIBILITY_SECRET) { summaryAttributes.add(context.getString(R.string.notifications_hidden)); } } if (appRow.appBypassDnd) { summaryAttributes.add(context.getString(R.string.notifications_priority)); } final int N = summaryAttributes.size(); for (int i = 0; i < N; i++) { if (i > 0) { summary.append(context.getString(R.string.notifications_summary_divider)); } summary.append(summaryAttributes.get(i)); } return summary.toString(); } private class MemoryUpdater extends AsyncTask<Void, Void, ProcStatsPackageEntry> { Loading
src/com/android/settings/applications/ManageApplications.java +2 −2 Original line number Diff line number Diff line Loading @@ -788,8 +788,8 @@ public class ManageApplications extends InstrumentedFragment mPm = mContext.getPackageManager(); mFilterMode = filterMode; if (mManageApplications.mListType == LIST_TYPE_NOTIFICATION) { mExtraInfoBridge = new AppStateNotificationBridge(mContext.getPackageManager(), mState, this, manageApplications.mNotifBackend); mExtraInfoBridge = new AppStateNotificationBridge(mContext, mState, this, manageApplications.mNotifBackend); } else if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) { mExtraInfoBridge = new AppStateUsageBridge(mContext, mState, this); } else if (mManageApplications.mListType == LIST_TYPE_HIGH_POWER) { Loading
src/com/android/settings/applications/NotificationApps.java +3 −3 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ public class NotificationApps extends ManageApplications { ApplicationsState.getInstance((Application) context.getApplicationContext()); mSession = mAppState.newSession(this); mNotifBackend = new NotificationBackend(); mExtraInfoBridge = new AppStateNotificationBridge(mContext.getPackageManager(), mExtraInfoBridge = new AppStateNotificationBridge(mContext, mAppState, this, mNotifBackend); } Loading @@ -72,8 +72,8 @@ public class NotificationApps extends ManageApplications { if (apps.size() == 0) { mLoader.setSummary(this, mContext.getString(R.string.notification_summary_none)); } else { mLoader.setSummary(this, mContext.getString(R.string.notification_summary, apps.size())); mLoader.setSummary(this, mContext.getResources().getQuantityString( R.plurals.notification_summary, apps.size(), apps.size())); } } Loading