Loading res/layout/notification_log_row.xml +12 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ android:src="@drawable/ic_notifications_alert" /> <ImageView android:id="@+id/profile_badge" android:layout_width="@*android:dimen/status_bar_icon_size" android:layout_height="@*android:dimen/status_bar_icon_size" android:layout_centerVertical="true" android:layout_marginEnd="6dp" android:paddingTop="1dp" android:scaleType="fitCenter" android:visibility="gone" android:layout_toStartOf="@id/timestamp" /> <DateTimeView android:id="@+id/timestamp" android:layout_width="wrap_content" Loading src/com/android/settings/notification/NotificationStation.java +17 −10 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class NotificationStation extends SettingsPreferenceFragment { public Drawable pkgicon; public CharSequence pkgname; public Drawable icon; public boolean badged; public CharSequence title; public CharSequence text; public int priority; Loading Loading @@ -268,8 +269,8 @@ public class NotificationStation extends SettingsPreferenceFragment { if (needsAdd) { mNotificationInfos.addFirst(newInfo); getPreferenceScreen().addPreference(new HistoricalNotificationPreference( getPrefContext(), mNotificationInfos.peekFirst(), -1 * mNotificationInfos.size())); getPrefContext(), mNotificationInfos.peekFirst(), -1 * mNotificationInfos.size())); } } Loading Loading @@ -338,9 +339,9 @@ public class NotificationStation extends SettingsPreferenceFragment { return text == null ? null : String.valueOf(text); } private static Drawable loadIcon(Context context, StatusBarNotification sbn) { private Drawable loadIcon(HistoricalNotificationInfo info, StatusBarNotification sbn) { Drawable draw = sbn.getNotification().getSmallIcon().loadDrawableAsUser( sbn.getPackageContext(context), sbn.getUserId()); sbn.getPackageContext(mContext), info.user); if (draw == null) { return null; } Loading @@ -367,7 +368,6 @@ public class NotificationStation extends SettingsPreferenceFragment { * booted), stores the data we need to present them, and sorts them chronologically for display. */ private void loadNotifications() { final int currentUserId = ActivityManager.getCurrentUser(); try { StatusBarNotification[] active = mNoMan.getActiveNotifications( mContext.getPackageName()); Loading @@ -380,9 +380,6 @@ public class NotificationStation extends SettingsPreferenceFragment { for (StatusBarNotification[] resultSet : new StatusBarNotification[][] { active, dismissed }) { for (StatusBarNotification sbn : resultSet) { if (sbn.getUserId() != UserHandle.USER_ALL & sbn.getUserId() != currentUserId) { continue; } if (sbn.getNotification().isGroupSummary()) { continue; } Loading @@ -406,8 +403,10 @@ public class NotificationStation extends SettingsPreferenceFragment { final Notification n = sbn.getNotification(); final HistoricalNotificationInfo info = new HistoricalNotificationInfo(); info.pkg = sbn.getPackageName(); info.user = sbn.getUserId(); info.icon = loadIcon(mContext, sbn); info.user = sbn.getUserId() == UserHandle.USER_ALL ? UserHandle.USER_SYSTEM : sbn.getUserId(); info.badged = info.user != ActivityManager.getCurrentUser(); info.icon = loadIcon(info, sbn); if (info.icon == null) { info.icon = loadPackageIconDrawable(info.pkg, info.user); } Loading Loading @@ -645,6 +644,7 @@ public class NotificationStation extends SettingsPreferenceFragment { private final HistoricalNotificationInfo mInfo; private static long sLastExpandedTimestamp; // quick hack to keep things from collapsing public ViewGroup mItemView; // hack to update prefs fast; private Context mContext; public HistoricalNotificationPreference(Context context, HistoricalNotificationInfo info, int order) { Loading @@ -653,6 +653,7 @@ public class NotificationStation extends SettingsPreferenceFragment { setOrder(order); setKey(info.key); mInfo = info; mContext = context; } @Override Loading Loading @@ -697,6 +698,12 @@ public class NotificationStation extends SettingsPreferenceFragment { ((ImageView) mItemView.findViewById(R.id.icon)).setImageDrawable(info.icon); } ImageView profileBadge = mItemView.findViewById(R.id.profile_badge); Drawable profile = mContext.getPackageManager().getUserBadgeForDensity( UserHandle.of(info.user), -1); profileBadge.setImageDrawable(profile); profileBadge.setVisibility(info.badged ? View.VISIBLE : View.GONE); ((DateTimeView) mItemView.findViewById(R.id.timestamp)).setTime(mInfo.timestamp); ((TextView) mItemView.findViewById(R.id.notification_extra)) Loading Loading
res/layout/notification_log_row.xml +12 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,18 @@ android:src="@drawable/ic_notifications_alert" /> <ImageView android:id="@+id/profile_badge" android:layout_width="@*android:dimen/status_bar_icon_size" android:layout_height="@*android:dimen/status_bar_icon_size" android:layout_centerVertical="true" android:layout_marginEnd="6dp" android:paddingTop="1dp" android:scaleType="fitCenter" android:visibility="gone" android:layout_toStartOf="@id/timestamp" /> <DateTimeView android:id="@+id/timestamp" android:layout_width="wrap_content" Loading
src/com/android/settings/notification/NotificationStation.java +17 −10 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public class NotificationStation extends SettingsPreferenceFragment { public Drawable pkgicon; public CharSequence pkgname; public Drawable icon; public boolean badged; public CharSequence title; public CharSequence text; public int priority; Loading Loading @@ -268,8 +269,8 @@ public class NotificationStation extends SettingsPreferenceFragment { if (needsAdd) { mNotificationInfos.addFirst(newInfo); getPreferenceScreen().addPreference(new HistoricalNotificationPreference( getPrefContext(), mNotificationInfos.peekFirst(), -1 * mNotificationInfos.size())); getPrefContext(), mNotificationInfos.peekFirst(), -1 * mNotificationInfos.size())); } } Loading Loading @@ -338,9 +339,9 @@ public class NotificationStation extends SettingsPreferenceFragment { return text == null ? null : String.valueOf(text); } private static Drawable loadIcon(Context context, StatusBarNotification sbn) { private Drawable loadIcon(HistoricalNotificationInfo info, StatusBarNotification sbn) { Drawable draw = sbn.getNotification().getSmallIcon().loadDrawableAsUser( sbn.getPackageContext(context), sbn.getUserId()); sbn.getPackageContext(mContext), info.user); if (draw == null) { return null; } Loading @@ -367,7 +368,6 @@ public class NotificationStation extends SettingsPreferenceFragment { * booted), stores the data we need to present them, and sorts them chronologically for display. */ private void loadNotifications() { final int currentUserId = ActivityManager.getCurrentUser(); try { StatusBarNotification[] active = mNoMan.getActiveNotifications( mContext.getPackageName()); Loading @@ -380,9 +380,6 @@ public class NotificationStation extends SettingsPreferenceFragment { for (StatusBarNotification[] resultSet : new StatusBarNotification[][] { active, dismissed }) { for (StatusBarNotification sbn : resultSet) { if (sbn.getUserId() != UserHandle.USER_ALL & sbn.getUserId() != currentUserId) { continue; } if (sbn.getNotification().isGroupSummary()) { continue; } Loading @@ -406,8 +403,10 @@ public class NotificationStation extends SettingsPreferenceFragment { final Notification n = sbn.getNotification(); final HistoricalNotificationInfo info = new HistoricalNotificationInfo(); info.pkg = sbn.getPackageName(); info.user = sbn.getUserId(); info.icon = loadIcon(mContext, sbn); info.user = sbn.getUserId() == UserHandle.USER_ALL ? UserHandle.USER_SYSTEM : sbn.getUserId(); info.badged = info.user != ActivityManager.getCurrentUser(); info.icon = loadIcon(info, sbn); if (info.icon == null) { info.icon = loadPackageIconDrawable(info.pkg, info.user); } Loading Loading @@ -645,6 +644,7 @@ public class NotificationStation extends SettingsPreferenceFragment { private final HistoricalNotificationInfo mInfo; private static long sLastExpandedTimestamp; // quick hack to keep things from collapsing public ViewGroup mItemView; // hack to update prefs fast; private Context mContext; public HistoricalNotificationPreference(Context context, HistoricalNotificationInfo info, int order) { Loading @@ -653,6 +653,7 @@ public class NotificationStation extends SettingsPreferenceFragment { setOrder(order); setKey(info.key); mInfo = info; mContext = context; } @Override Loading Loading @@ -697,6 +698,12 @@ public class NotificationStation extends SettingsPreferenceFragment { ((ImageView) mItemView.findViewById(R.id.icon)).setImageDrawable(info.icon); } ImageView profileBadge = mItemView.findViewById(R.id.profile_badge); Drawable profile = mContext.getPackageManager().getUserBadgeForDensity( UserHandle.of(info.user), -1); profileBadge.setImageDrawable(profile); profileBadge.setVisibility(info.badged ? View.VISIBLE : View.GONE); ((DateTimeView) mItemView.findViewById(R.id.timestamp)).setTime(mInfo.timestamp); ((TextView) mItemView.findViewById(R.id.notification_extra)) Loading