Lines Matching refs:pkg

236                         for (String pkg : mBlockedPackages) {
238 out.attribute(null, ATTR_NAME, pkg);
255 public boolean areNotificationsEnabledForPackage(String pkg) {
257 return areNotificationsEnabledForPackageInt(pkg);
261 private boolean areNotificationsEnabledForPackageInt(String pkg) {
262 final boolean enabled = !mBlockedPackages.contains(pkg);
264 Slog.v(TAG, "notifications are " + (enabled?"en":"dis") + "abled for " + pkg);
269 public void setNotificationsEnabledForPackage(String pkg, boolean enabled) {
272 Slog.v(TAG, (enabled?"en":"dis") + "abling notifications for " + pkg);
275 mBlockedPackages.remove(pkg);
277 mBlockedPackages.add(pkg);
285 if (r.pkg.equals(pkg)) {
310 String pkg;
324 final String pkg;
334 NotificationRecord(String pkg, String tag, int id, int uid, int initialPid,
337 this.pkg = pkg;
350 + " / " + idDebugString(baseContext, this.pkg, notification.icon));
372 + " pkg=" + pkg
383 final String pkg;
387 ToastRecord(int pid, String pkg, ITransientNotification callback, int duration)
390 this.pkg = pkg;
408 + " pkg=" + pkg
449 public void onNotificationClick(String pkg, String tag, int id) {
452 cancelNotification(pkg, tag, id, Notification.FLAG_AUTO_CANCEL,
457 public void onNotificationClear(String pkg, String tag, int id) {
460 cancelNotification(pkg, tag, id, 0,
497 public void onNotificationError(String pkg, String tag, int id,
499 Slog.d(TAG, "onNotification error pkg=" + pkg + " tag=" + tag + " id=" + id
503 cancelNotification(pkg, tag, id, 0, 0, false, UserHandle.getUserId(uid));
506 ActivityManagerNative.getDefault().crashApplication(uid, initialPid, pkg,
507 "Bad notification posted from package " + pkg
698 public void enqueueToast(String pkg, ITransientNotification callback, int duration)
700 if (DBG) Slog.i(TAG, "enqueueToast pkg=" + pkg + " callback=" + callback + " duration=" + duration);
702 if (pkg == null || callback == null) {
703 Slog.e(TAG, "Not doing toast. pkg=" + pkg + " callback=" + callback);
707 final boolean isSystemToast = ("android".equals(pkg));
709 if (ENABLE_BLOCKED_TOASTS && !isSystemToast && !areNotificationsEnabledForPackageInt(pkg)) {
710 Slog.e(TAG, "Suppressing toast from package " + pkg + " by user request.");
719 int index = indexOfToastLocked(pkg, callback);
733 if (r.pkg.equals(pkg)) {
737 + " toasts. Not showing more. Package=" + pkg);
744 record = new ToastRecord(callingPid, pkg, callback, duration);
762 public void cancelToast(String pkg, ITransientNotification callback) {
763 Slog.i(TAG, "cancelToast pkg=" + pkg + " callback=" + callback);
765 if (pkg == null || callback == null) {
766 Slog.e(TAG, "Not cancelling notification. pkg=" + pkg + " callback=" + callback);
773 int index = indexOfToastLocked(pkg, callback);
777 Slog.w(TAG, "Toast already cancelled. pkg=" + pkg + " callback=" + callback);
788 if (DBG) Slog.d(TAG, "Show pkg=" + record.pkg + " callback=" + record.callback);
795 + " in package " + record.pkg);
817 + " in package " + record.pkg);
841 if (DBG) Slog.d(TAG, "Timeout pkg=" + record.pkg + " callback=" + record.callback);
843 int index = indexOfToastLocked(record.pkg, record.callback);
851 private int indexOfToastLocked(String pkg, ITransientNotification callback)
858 if (r.pkg.equals(pkg) && r.callback.asBinder() == cbak) {
901 public void enqueueNotificationWithTag(String pkg, String tag, int id, Notification notification,
904 enqueueNotificationInternal(pkg, Binder.getCallingUid(), Binder.getCallingPid(),
914 public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
918 Slog.v(TAG, "enqueueNotificationInternal: pkg=" + pkg + " id=" + id + " notification=" + notification);
920 checkCallerIsSystemOrSameApp(pkg);
921 final boolean isSystemNotification = ("android".equals(pkg));
924 callingUid, userId, true, false, "enqueueNotification", pkg);
935 if (r.pkg.equals(pkg) && r.userId == userId) {
939 + " notifications. Not showing more. package=" + pkg);
949 if (!pkg.equals("com.android.providers.downloads")
951 EventLog.writeEvent(EventLogTags.NOTIFICATION_ENQUEUE, pkg, id, tag, userId,
955 if (pkg == null || notification == null) {
956 throw new IllegalArgumentException("null not allowed: pkg=" + pkg
961 throw new IllegalArgumentException("contentView required: pkg=" + pkg
985 if (ENABLE_BLOCKED_NOTIFICATIONS && !isSystemNotification && !areNotificationsEnabledForPackageInt(pkg)) {
987 Slog.e(TAG, "Suppressing notification from package " + pkg + " by user request.");
1003 NotificationRecord r = new NotificationRecord(pkg, tag, id,
1009 int index = indexOfNotificationLocked(pkg, tag, id, userId);
1039 pkg, id, tag, r.uid, r.initialPid, score, notification, user);
1064 sendAccessibilityEvent(notification, pkg);
1227 Slog.w(TAG, "canceled PendingIntent for " + r.pkg, ex);
1282 private void cancelNotification(String pkg, String tag, int id, int mustHaveFlags,
1284 EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL, pkg, id, tag, userId,
1288 int index = indexOfNotificationLocked(pkg, tag, id, userId);
1325 boolean cancelAllNotificationsInt(String pkg, int mustHaveFlags,
1327 EventLog.writeEvent(EventLogTags.NOTIFICATION_CANCEL_ALL, pkg, userId,
1339 if (r.userId == UserHandle.USER_ALL && pkg == null) {
1348 if (pkg != null && !r.pkg.equals(pkg)) {
1365 public void cancelNotificationWithTag(String pkg, String tag, int id, int userId) {
1366 checkCallerIsSystemOrSameApp(pkg);
1368 Binder.getCallingUid(), userId, true, false, "cancelNotificationWithTag", pkg);
1370 cancelNotification(pkg, tag, id, 0,
1375 public void cancelAllNotifications(String pkg, int userId) {
1376 checkCallerIsSystemOrSameApp(pkg);
1379 Binder.getCallingUid(), userId, true, false, "cancelAllNotifications", pkg);
1383 cancelAllNotificationsInt(pkg, 0, Notification.FLAG_FOREGROUND_SERVICE, true, userId);
1394 void checkCallerIsSystemOrSameApp(String pkg) {
1401 pkg, 0, UserHandle.getCallingUserId());
1404 + pkg + " which is owned by uid " + ai.uid);
1407 throw new SecurityException("Unknown package " + pkg + "\n" + re);
1465 private int indexOfNotificationLocked(String pkg, String tag, int id, int userId)
1483 if (r.pkg.equals(pkg)) {