use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by DirtyUnicorns.
the class BaseStatusBar method createNotificationViews.
protected NotificationData.Entry createNotificationViews(StatusBarNotification sbn) {
if (DEBUG) {
Log.d(TAG, "createNotificationViews(notification=" + sbn);
}
final StatusBarIconView iconView = createIcon(sbn);
if (iconView == null) {
return null;
}
// Construct the expanded view.
NotificationData.Entry entry = new NotificationData.Entry(sbn, iconView);
if (!inflateViews(entry, mStackScroller)) {
handleNotificationError(sbn, "Couldn't expand RemoteViews for: " + sbn);
return null;
}
return entry;
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by crdroidandroid.
the class PhoneStatusBar method addNotification.
@Override
public void addNotification(StatusBarNotification notification, RankingMap ranking, Entry oldEntry) {
if (DEBUG)
Log.d(TAG, "addNotification key=" + notification.getKey());
mNotificationData.updateRanking(ranking);
Entry shadeEntry = createNotificationViews(notification);
if (shadeEntry == null) {
return;
}
boolean isHeadsUped = shouldPeek(shadeEntry);
if (isHeadsUped) {
// filter out alarms if required
if (notification.getNotification().category != null && notification.getNotification().category.equals(Notification.CATEGORY_ALARM)) {
boolean fullscreenAlarm = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.SHOW_ALARM_FULLSCREEN, 0, mCurrentUserId) == 1;
if (fullscreenAlarm) {
if (DEBUG)
Log.d(TAG, "launching alarm notification in fullscreen mode");
isHeadsUped = false;
}
}
if (isHeadsUped) {
mHeadsUpManager.showNotification(shadeEntry);
// Mark as seen immediately
setNotificationShown(notification);
}
}
if (!isHeadsUped && notification.getNotification().fullScreenIntent != null) {
if (shouldSuppressFullScreenIntent(notification.getKey())) {
if (DEBUG) {
Log.d(TAG, "No Fullscreen intent: suppressed by DND: " + notification.getKey());
}
} else if (importanceToLevel(mNotificationData.getImportance(notification.getKey())) < importanceToLevel(NotificationListenerService.Ranking.IMPORTANCE_MAX)) {
if (DEBUG) {
Log.d(TAG, "No Fullscreen intent: not important enough: " + notification.getKey());
}
} else {
// Stop screensaver if the notification has a full-screen intent.
// (like an incoming phone call)
awakenDreams();
// not immersive & a full-screen alert should be shown
if (DEBUG)
Log.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
try {
EventLog.writeEvent(EventLogTags.SYSUI_FULLSCREEN_NOTIFICATION, notification.getKey());
notification.getNotification().fullScreenIntent.send();
shadeEntry.notifyFullScreenIntentLaunched();
MetricsLogger.count(mContext, "note_fullscreen", 1);
} catch (PendingIntent.CanceledException e) {
}
}
} else {
tick(notification, true, false, null);
}
addNotificationViews(shadeEntry, ranking);
// Recalculate the position of the sliding windows and the titles.
setAreThereNotifications();
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by ParanoidAndroid.
the class PhoneStatusBar method copyNotifications.
private static void copyNotifications(ArrayList<Pair<IBinder, StatusBarNotification>> dest, NotificationData source) {
int N = source.size();
for (int i = 0; i < N; i++) {
NotificationData.Entry entry = source.get(i);
dest.add(Pair.create(entry.key, entry.notification));
}
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by ParanoidAndroid.
the class TabletStatusBar method copyNotifications.
private static void copyNotifications(ArrayList<Pair<IBinder, StatusBarNotification>> dest, NotificationData source) {
int N = source.size();
for (int i = 0; i < N; i++) {
NotificationData.Entry entry = source.get(i);
dest.add(Pair.create(entry.key, entry.notification));
}
}
use of com.android.systemui.statusbar.NotificationData.Entry in project android_frameworks_base by ParanoidAndroid.
the class TabletStatusBar method loadNotificationPanel.
private void loadNotificationPanel() {
int N = mNotificationData.size();
ArrayList<View> toShow = new ArrayList<View>();
final boolean provisioned = isDeviceProvisioned();
// If the device hasn't been through Setup, we only show system notifications
for (int i = 0; i < N; i++) {
Entry ent = mNotificationData.get(N - i - 1);
if (provisioned || showNotificationEvenIfUnprovisioned(ent.notification) && !notificationIsForCurrentUser(ent.notification)) {
toShow.add(ent.row);
}
}
ArrayList<View> toRemove = new ArrayList<View>();
for (int i = 0; i < mPile.getChildCount(); i++) {
View child = mPile.getChildAt(i);
if (!toShow.contains(child)) {
toRemove.add(child);
}
}
for (View remove : toRemove) {
mPile.removeView(remove);
}
for (int i = 0; i < toShow.size(); i++) {
View v = toShow.get(i);
if (v.getParent() == null) {
// the notification panel has the most important things at the bottom
mPile.addView(v, Math.min(toShow.size() - 1 - i, mPile.getChildCount()));
}
}
mNotificationPanel.setNotificationCount(toShow.size());
mNotificationPanel.setSettingsEnabled(isDeviceProvisioned());
}
Aggregations