diff options
| -rw-r--r-- | api/current.txt | 8 | ||||
| -rw-r--r-- | api/removed.txt | 5 | ||||
| -rw-r--r-- | api/system-current.txt | 8 | ||||
| -rw-r--r-- | api/system-removed.txt | 5 | ||||
| -rw-r--r-- | api/test-current.txt | 8 | ||||
| -rw-r--r-- | api/test-removed.txt | 5 | ||||
| -rw-r--r-- | core/java/android/app/Notification.java | 49 | ||||
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 2 |
8 files changed, 65 insertions, 25 deletions
diff --git a/api/current.txt b/api/current.txt index 24586f0669f8..d42be65ffb80 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5094,7 +5094,7 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 04c9c35428b3..6feafacb4944 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 7e9267106f77..cd71f1e27267 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5264,7 +5264,7 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 640dc81877a1..294751a94f23 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 d33c1fa57480..a3a616161b34 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -5104,7 +5104,7 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 @@ package android.app { 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 04c9c35428b3..6feafacb4944 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 8d769305e9e3..c78b3cde6fbe 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -880,14 +880,20 @@ public class Notification implements Parcelable /** * {@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 class Notification implements Parcelable 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 @@ public class Notification implements Parcelable * @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 @@ public class Notification implements Parcelable } /** + * @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 @@ public class Notification implements Parcelable } /** + * @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 @@ public class Notification implements Parcelable * * 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 @@ public class Notification implements Parcelable * * <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 53a403603a5b..a1aeeeaf7e06 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 @@ public class NotificationManagerService extends SystemService { 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; |