Merge "Notification cleanup"
diff --git a/api/current.txt b/api/current.txt
index 24586f0..d42be65 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -5094,7 +5094,7 @@
     ctor public Notification(android.os.Parcel);
     method public android.app.Notification clone();
     method public int describeContents();
-    method public int getBadgeIcon();
+    method public int getBadgeIconType();
     method public java.lang.String getChannel();
     method public java.lang.String getGroup();
     method public android.graphics.drawable.Icon getLargeIcon();
@@ -5138,7 +5138,7 @@
     field public static final java.lang.String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
     field public static final java.lang.String EXTRA_HISTORIC_MESSAGES = "android.messages.historic";
     field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText";
-    field public static final java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
+    field public static final deprecated java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
     field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
     field public static final java.lang.String EXTRA_MEDIA_SESSION = "android.mediaSession";
     field public static final java.lang.String EXTRA_MESSAGES = "android.messages";
@@ -5151,7 +5151,7 @@
     field public static final java.lang.String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
     field public static final java.lang.String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
     field public static final java.lang.String EXTRA_SHOW_WHEN = "android.showWhen";
-    field public static final java.lang.String EXTRA_SMALL_ICON = "android.icon";
+    field public static final deprecated java.lang.String EXTRA_SMALL_ICON = "android.icon";
     field public static final java.lang.String EXTRA_SUB_TEXT = "android.subText";
     field public static final java.lang.String EXTRA_SUMMARY_TEXT = "android.summaryText";
     field public static final java.lang.String EXTRA_TEMPLATE = "android.template";
@@ -5287,7 +5287,7 @@
     method public android.app.Notification.Builder addExtras(android.os.Bundle);
     method public android.app.Notification.Builder addPerson(java.lang.String);
     method public android.app.Notification build();
-    method public android.app.Notification.Builder chooseBadgeIcon(int);
+    method public android.app.Notification.Builder chooseBadgeIconType(int);
     method public android.widget.RemoteViews createBigContentView();
     method public android.widget.RemoteViews createContentView();
     method public android.widget.RemoteViews createHeadsUpContentView();
diff --git a/api/removed.txt b/api/removed.txt
index 04c9c35..6feafac 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -1,9 +1,14 @@
 package android.app {
 
   public class Notification implements android.os.Parcelable {
+    method public deprecated int getBadgeIcon();
     method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
   }
 
+  public static class Notification.Builder {
+    method public deprecated android.app.Notification.Builder chooseBadgeIcon(int);
+  }
+
   public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
     method public deprecated void showAsNotification(android.content.Context);
   }
diff --git a/api/system-current.txt b/api/system-current.txt
index 7e92671..cd71f1e 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5264,7 +5264,7 @@
     ctor public Notification(android.os.Parcel);
     method public android.app.Notification clone();
     method public int describeContents();
-    method public int getBadgeIcon();
+    method public int getBadgeIconType();
     method public java.lang.String getChannel();
     method public java.lang.String getGroup();
     method public android.graphics.drawable.Icon getLargeIcon();
@@ -5309,7 +5309,7 @@
     field public static final java.lang.String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
     field public static final java.lang.String EXTRA_HISTORIC_MESSAGES = "android.messages.historic";
     field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText";
-    field public static final java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
+    field public static final deprecated java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
     field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
     field public static final java.lang.String EXTRA_MEDIA_SESSION = "android.mediaSession";
     field public static final java.lang.String EXTRA_MESSAGES = "android.messages";
@@ -5322,7 +5322,7 @@
     field public static final java.lang.String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
     field public static final java.lang.String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
     field public static final java.lang.String EXTRA_SHOW_WHEN = "android.showWhen";
-    field public static final java.lang.String EXTRA_SMALL_ICON = "android.icon";
+    field public static final deprecated java.lang.String EXTRA_SMALL_ICON = "android.icon";
     field public static final java.lang.String EXTRA_SUBSTITUTE_APP_NAME = "android.substName";
     field public static final java.lang.String EXTRA_SUB_TEXT = "android.subText";
     field public static final java.lang.String EXTRA_SUMMARY_TEXT = "android.summaryText";
@@ -5460,7 +5460,7 @@
     method public android.app.Notification.Builder addExtras(android.os.Bundle);
     method public android.app.Notification.Builder addPerson(java.lang.String);
     method public android.app.Notification build();
-    method public android.app.Notification.Builder chooseBadgeIcon(int);
+    method public android.app.Notification.Builder chooseBadgeIconType(int);
     method public android.widget.RemoteViews createBigContentView();
     method public android.widget.RemoteViews createContentView();
     method public android.widget.RemoteViews createHeadsUpContentView();
diff --git a/api/system-removed.txt b/api/system-removed.txt
index 640dc81..294751a 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -1,9 +1,14 @@
 package android.app {
 
   public class Notification implements android.os.Parcelable {
+    method public deprecated int getBadgeIcon();
     method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
   }
 
+  public static class Notification.Builder {
+    method public deprecated android.app.Notification.Builder chooseBadgeIcon(int);
+  }
+
   public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
     method public deprecated void showAsNotification(android.content.Context);
   }
diff --git a/api/test-current.txt b/api/test-current.txt
index d33c1fa..a3a6161 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -5104,7 +5104,7 @@
     ctor public Notification(android.os.Parcel);
     method public android.app.Notification clone();
     method public int describeContents();
-    method public int getBadgeIcon();
+    method public int getBadgeIconType();
     method public java.lang.String getChannel();
     method public java.lang.String getGroup();
     method public android.graphics.drawable.Icon getLargeIcon();
@@ -5148,7 +5148,7 @@
     field public static final java.lang.String EXTRA_CONVERSATION_TITLE = "android.conversationTitle";
     field public static final java.lang.String EXTRA_HISTORIC_MESSAGES = "android.messages.historic";
     field public static final java.lang.String EXTRA_INFO_TEXT = "android.infoText";
-    field public static final java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
+    field public static final deprecated java.lang.String EXTRA_LARGE_ICON = "android.largeIcon";
     field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big";
     field public static final java.lang.String EXTRA_MEDIA_SESSION = "android.mediaSession";
     field public static final java.lang.String EXTRA_MESSAGES = "android.messages";
@@ -5161,7 +5161,7 @@
     field public static final java.lang.String EXTRA_SELF_DISPLAY_NAME = "android.selfDisplayName";
     field public static final java.lang.String EXTRA_SHOW_CHRONOMETER = "android.showChronometer";
     field public static final java.lang.String EXTRA_SHOW_WHEN = "android.showWhen";
-    field public static final java.lang.String EXTRA_SMALL_ICON = "android.icon";
+    field public static final deprecated java.lang.String EXTRA_SMALL_ICON = "android.icon";
     field public static final java.lang.String EXTRA_SUB_TEXT = "android.subText";
     field public static final java.lang.String EXTRA_SUMMARY_TEXT = "android.summaryText";
     field public static final java.lang.String EXTRA_TEMPLATE = "android.template";
@@ -5297,7 +5297,7 @@
     method public android.app.Notification.Builder addExtras(android.os.Bundle);
     method public android.app.Notification.Builder addPerson(java.lang.String);
     method public android.app.Notification build();
-    method public android.app.Notification.Builder chooseBadgeIcon(int);
+    method public android.app.Notification.Builder chooseBadgeIconType(int);
     method public android.widget.RemoteViews createBigContentView();
     method public android.widget.RemoteViews createContentView();
     method public android.widget.RemoteViews createHeadsUpContentView();
diff --git a/api/test-removed.txt b/api/test-removed.txt
index 04c9c35..6feafac 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -1,9 +1,14 @@
 package android.app {
 
   public class Notification implements android.os.Parcelable {
+    method public deprecated int getBadgeIcon();
     method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent);
   }
 
+  public static class Notification.Builder {
+    method public deprecated android.app.Notification.Builder chooseBadgeIcon(int);
+  }
+
   public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable {
     method public deprecated void showAsNotification(android.content.Context);
   }
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 8d76930..c78b3cd 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -880,14 +880,20 @@
     /**
      * {@link #extras} key: this is the resource ID of the notification's main small icon, as
      * supplied to {@link Builder#setSmallIcon(int)}.
+     *
+     * @deprecated Use {@link #getSmallIcon()}, which supports a wider variety of icon sources.
      */
+    @Deprecated
     public static final String EXTRA_SMALL_ICON = "android.icon";
 
     /**
      * {@link #extras} key: this is a bitmap to be used instead of the small icon when showing the
      * notification payload, as
      * supplied to {@link Builder#setLargeIcon(android.graphics.Bitmap)}.
+     *
+     * @deprecated Use {@link #getLargeIcon()}, which supports a wider variety of icon sources.
      */
+    @Deprecated
     public static final String EXTRA_LARGE_ICON = "android.largeIcon";
 
     /**
@@ -1029,13 +1035,6 @@
     public static final String EXTRA_COLORIZED = "android.colorized";
 
     /**
-     * {@link #extras} key: the user that built the notification.
-     *
-     * @hide
-     */
-    public static final String EXTRA_ORIGINATING_USERID = "android.originatingUserId";
-
-    /**
      * @hide
      */
     public static final String EXTRA_BUILDER_APPLICATION_INFO = "android.appInfo";
@@ -2298,16 +2297,14 @@
      * @hide
      */
     public static void addFieldsFromContext(Context context, Notification notification) {
-        addFieldsFromContext(context.getApplicationInfo(), context.getUserId(), notification);
+        addFieldsFromContext(context.getApplicationInfo(), notification);
     }
 
     /**
      * @hide
      */
-    public static void addFieldsFromContext(ApplicationInfo ai, int userId,
-            Notification notification) {
+    public static void addFieldsFromContext(ApplicationInfo ai, Notification notification) {
         notification.extras.putParcelable(EXTRA_BUILDER_APPLICATION_INFO, ai);
-        notification.extras.putInt(EXTRA_ORIGINATING_USERID, userId);
     }
 
     @Override
@@ -2434,15 +2431,26 @@
     }
 
     /**
+     * @removed
      * Returns what icon should be shown for this notification if it is being displayed in a
      * Launcher that supports badging. Will be one of {@link #BADGE_ICON_NONE},
      * {@link #BADGE_ICON_SMALL}, or {@link #BADGE_ICON_LARGE}.
      */
+    @Deprecated
     public int getBadgeIcon() {
         return mBadgeIcon;
     }
 
     /**
+     * Returns what icon should be shown for this notification if it is being displayed in a
+     * Launcher that supports badging. Will be one of {@link #BADGE_ICON_NONE},
+     * {@link #BADGE_ICON_SMALL}, or {@link #BADGE_ICON_LARGE}.
+     */
+    public int getBadgeIconType() {
+        return mBadgeIcon;
+    }
+
+    /**
      * Returns the {@link ShortcutInfo#getId() id} that this notification supersedes, if any.
      */
     public String getShortcutId() {
@@ -2684,6 +2692,7 @@
         }
 
         /**
+         * @removed
          * Sets which icon to display as a badge for this notification.
          *
          * Must be one of {@link #BADGE_ICON_NONE}, {@link #BADGE_ICON_SMALL},
@@ -2691,12 +2700,26 @@
          *
          * Note: This value might be ignored, for launchers that don't support badge icons.
          */
+        @Deprecated
         public Builder chooseBadgeIcon(int icon) {
             mN.mBadgeIcon = icon;
             return this;
         }
 
         /**
+         * Sets which icon to display as a badge for this notification.
+         *
+         * Must be one of {@link #BADGE_ICON_NONE}, {@link #BADGE_ICON_SMALL},
+         * {@link #BADGE_ICON_LARGE}.
+         *
+         * Note: This value might be ignored, for launchers that don't support badge icons.
+         */
+        public Builder chooseBadgeIconType(int icon) {
+            mN.mBadgeIcon = icon;
+            return this;
+        }
+
+        /**
          * Specifies the channel the notification should be delivered on.
          */
         public Builder setChannel(String channelId) {
@@ -3272,7 +3295,9 @@
          *
          * <P>
          * Depending on user preferences, this annotation may allow the notification to pass
-         * through interruption filters, and to appear more prominently in the user interface.
+         * through interruption filters, if this notification is of category {@link #CATEGORY_CALL}
+         * or {@link #CATEGORY_MESSAGE}. The addition of people may also cause this notification to
+         * appear more prominently in the user interface.
          * </P>
          *
          * <P>
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 53a4036..a1aeeea 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3099,7 +3099,7 @@
             final ApplicationInfo ai = mPackageManagerClient.getApplicationInfoAsUser(
                     pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING,
                     (userId == UserHandle.USER_ALL) ? UserHandle.USER_SYSTEM : userId);
-            Notification.addFieldsFromContext(ai, userId, notification);
+            Notification.addFieldsFromContext(ai, notification);
         } catch (NameNotFoundException e) {
             Slog.e(TAG, "Cannot create a context for sending app", e);
             return;