private static void putNotificationDetails(NotificationRecord r, ContentValues outCv) { outCv.put(COL_NOTIFICATION_ID, r.sbn.getId()); if (r.sbn.getTag() != null) { outCv.put(COL_TAG, r.sbn.getTag()); } outCv.put(COL_WHEN_MS, r.sbn.getPostTime()); outCv.put(COL_FLAGS, r.getNotification().flags); outCv.put(COL_PRIORITY, r.getNotification().priority); if (r.getNotification().category != null) { outCv.put(COL_CATEGORY, r.getNotification().category); } outCv.put( COL_ACTION_COUNT, r.getNotification().actions != null ? r.getNotification().actions.length : 0); }
public void countApiUse(NotificationRecord record) { final Notification n = record.getNotification(); if (n.actions != null) { numWithActions++; } if ((n.flags & Notification.FLAG_FOREGROUND_SERVICE) != 0) { numForegroundService++; } if ((n.flags & Notification.FLAG_ONGOING_EVENT) != 0) { numOngoing++; } if ((n.flags & Notification.FLAG_AUTO_CANCEL) != 0) { numAutoCancel++; } if ((n.defaults & Notification.DEFAULT_SOUND) != 0 || (n.defaults & Notification.DEFAULT_VIBRATE) != 0 || n.sound != null || n.vibrate != null) { numInterrupt++; } switch (n.visibility) { case Notification.VISIBILITY_PRIVATE: numPrivate++; break; case Notification.VISIBILITY_SECRET: numSecret++; break; } switch (n.priority) { case Notification.PRIORITY_MAX: numPriorityMax++; break; case Notification.PRIORITY_HIGH: numPriorityHigh++; break; case Notification.PRIORITY_LOW: numPriorityLow++; break; case Notification.PRIORITY_MIN: numPriorityMin++; break; } for (String Key : n.extras.keySet()) { if (Notification.EXTRA_BIG_TEXT.equals(key)) { numWithBigText++; } else if (Notification.EXTRA_PICTURE.equals(key)) { numWithBigPicture++; } else if (Notification.EXTRA_LARGE_ICON.equals(key)) { numWithLargeIcon++; } else if (Notification.EXTRA_TEXT_LINES.equals(key)) { numWithInbox++; } else if (Notification.EXTRA_MEDIA_SESSION.equals(key)) { numWithMediaSession++; } else if (Notification.EXTRA_TITLE.equals(key)) { numWithTitle++; } else if (Notification.EXTRA_TEXT.equals(key)) { numWithText++; } else if (Notification.EXTRA_SUB_TEXT.equals(key)) { numWithSubText++; } else if (Notification.EXTRA_INFO_TEXT.equals(key)) { numWithInfoText++; } } }