use of android.service.notification.StatusBarNotification in project android_frameworks_base by ParanoidAndroid.
the class PhoneStatusBar method removeNotification.
public void removeNotification(IBinder key) {
StatusBarNotification old = removeNotificationViews(key);
if (SPEW)
Slog.d(TAG, "removeNotification key=" + key + " old=" + old);
if (old != null) {
// Cancel the ticker if it's still running
mTicker.removeEntry(old);
// Recalculate the position of the sliding windows and the titles.
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
if (ENABLE_INTRUDERS && old == mCurrentlyIntrudingNotification) {
mHandler.sendEmptyMessage(MSG_HIDE_INTRUDER);
}
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0) {
animateCollapsePanels();
}
}
setAreThereNotifications();
}
use of android.service.notification.StatusBarNotification in project android_frameworks_base by ParanoidAndroid.
the class PhoneStatusBar method recreateStatusBar.
private void recreateStatusBar() {
mRecreating = true;
mStatusBarContainer.removeAllViews();
// extract icons from the soon-to-be recreated viewgroup.
int nIcons = mStatusIcons.getChildCount();
ArrayList<StatusBarIcon> icons = new ArrayList<StatusBarIcon>(nIcons);
ArrayList<String> iconSlots = new ArrayList<String>(nIcons);
for (int i = 0; i < nIcons; i++) {
StatusBarIconView iconView = (StatusBarIconView) mStatusIcons.getChildAt(i);
icons.add(iconView.getStatusBarIcon());
iconSlots.add(iconView.getStatusBarSlot());
}
// extract notifications.
int nNotifs = mNotificationData.size();
ArrayList<Pair<IBinder, StatusBarNotification>> notifications = new ArrayList<Pair<IBinder, StatusBarNotification>>(nNotifs);
copyNotifications(notifications, mNotificationData);
mNotificationData.clear();
makeStatusBarView();
repositionNavigationBar();
mNavigationBarView.updateResources();
// recreate StatusBarIconViews.
for (int i = 0; i < nIcons; i++) {
StatusBarIcon icon = icons.get(i);
String slot = iconSlots.get(i);
addIcon(slot, i, i, icon);
}
// recreate notifications.
for (int i = 0; i < nNotifs; i++) {
Pair<IBinder, StatusBarNotification> notifData = notifications.get(i);
addNotificationViews(notifData.first, notifData.second);
}
setAreThereNotifications();
mStatusBarContainer.addView(mStatusBarWindow);
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
mRecreating = false;
}
use of android.service.notification.StatusBarNotification in project android_frameworks_base by ResurrectionRemix.
the class NotificationData method filterAndSort.
// TODO: This should not be public. Instead the Environment should notify this class when
// anything changed, and this class should call back the UI so it updates itself.
public void filterAndSort() {
mSortedAndFiltered.clear();
synchronized (mEntries) {
final int N = mEntries.size();
for (int i = 0; i < N; i++) {
Entry entry = mEntries.valueAt(i);
StatusBarNotification sbn = entry.notification;
if (shouldFilterOut(sbn)) {
continue;
}
mSortedAndFiltered.add(entry);
}
}
Collections.sort(mSortedAndFiltered, mRankingComparator);
}
use of android.service.notification.StatusBarNotification in project android_frameworks_base by ResurrectionRemix.
the class BugreportReceiverTest method cancelExistingNotifications.
private void cancelExistingNotifications() {
NotificationManager nm = NotificationManager.from(mContext);
for (StatusBarNotification notification : nm.getActiveNotifications()) {
int id = notification.getId();
Log.i(TAG, "Canceling existing notification (id=" + id + ")");
nm.cancel(id);
}
}
use of android.service.notification.StatusBarNotification in project android_frameworks_base by ResurrectionRemix.
the class PhoneStatusBar method maybeEscalateHeadsUp.
@Override
public void maybeEscalateHeadsUp() {
Collection<HeadsUpManager.HeadsUpEntry> entries = mHeadsUpManager.getAllEntries();
for (HeadsUpManager.HeadsUpEntry entry : entries) {
final StatusBarNotification sbn = entry.entry.notification;
final Notification notification = sbn.getNotification();
if (notification.fullScreenIntent != null) {
if (DEBUG) {
Log.d(TAG, "converting a heads up to fullScreen");
}
try {
EventLog.writeEvent(EventLogTags.SYSUI_HEADS_UP_ESCALATION, sbn.getKey());
notification.fullScreenIntent.send();
entry.entry.notifyFullScreenIntentLaunched();
} catch (PendingIntent.CanceledException e) {
}
}
}
mHeadsUpManager.releaseAllImmediately();
}
Aggregations