Loading api/current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5117,6 +5117,7 @@ package android.app { method public java.lang.String getChannel(); method public java.lang.String getChannel(); method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5161,6 +5162,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5346,6 +5349,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int); api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5290,6 +5290,7 @@ package android.app { method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String); method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5335,6 +5336,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5522,6 +5525,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int); api/test-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5129,6 +5129,7 @@ package android.app { method public java.lang.String getChannel(); method public java.lang.String getChannel(); method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5173,6 +5174,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5358,6 +5361,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int); core/java/android/app/Notification.java +57 −3 Original line number Original line Diff line number Diff line Loading @@ -103,8 +103,7 @@ public class Notification implements Parcelable /** /** * An activity that provides a user interface for adjusting notification preferences for its * An activity that provides a user interface for adjusting notification preferences for its * containing application. Optional but recommended for apps that post * containing application. * {@link android.app.Notification Notifications}. */ */ @SdkConstant(SdkConstantType.INTENT_CATEGORY) @SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String INTENT_CATEGORY_NOTIFICATION_PREFERENCES public static final String INTENT_CATEGORY_NOTIFICATION_PREFERENCES Loading @@ -113,10 +112,24 @@ public class Notification implements Parcelable /** /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain a {@link NotificationChannel#getId() channel id} that can be used to narrow down * contain a {@link NotificationChannel#getId() channel id} that can be used to narrow down * what in app notifications settings should be shown. * what settings should be shown in the target app. */ */ public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"; public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"; /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain the tag provided to {@link NotificationManager#notify(String, int, Notification)} * that can be used to narrow down what settings should be shown in the target app. */ public static final String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain the id provided to {@link NotificationManager#notify(String, int, Notification)} * that can be used to narrow down what settings should be shown in the target app. */ public static final String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; /** /** * Use all default values (where applicable). * Use all default values (where applicable). */ */ Loading Loading @@ -1082,6 +1095,7 @@ public class Notification implements Parcelable private long mTimeout; private long mTimeout; private String mShortcutId; private String mShortcutId; private CharSequence mSettingsText; /** /** * If this notification is being shown as a badge, always show as a number. * If this notification is being shown as a badge, always show as a number. Loading Loading @@ -1851,6 +1865,10 @@ public class Notification implements Parcelable } } mBadgeIcon = parcel.readInt(); mBadgeIcon = parcel.readInt(); if (parcel.readInt() != 0) { mSettingsText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); } } } @Override @Override Loading Loading @@ -1960,6 +1978,9 @@ public class Notification implements Parcelable that.mChannelId = this.mChannelId; that.mChannelId = this.mChannelId; that.mTimeout = this.mTimeout; that.mTimeout = this.mTimeout; that.mShortcutId = this.mShortcutId; that.mBadgeIcon = this.mBadgeIcon; that.mSettingsText = this.mSettingsText; if (!heavy) { if (!heavy) { that.lightenPayload(); // will clean out extras that.lightenPayload(); // will clean out extras Loading Loading @@ -2229,6 +2250,13 @@ public class Notification implements Parcelable } } parcel.writeInt(mBadgeIcon); parcel.writeInt(mBadgeIcon); if (mSettingsText != null) { parcel.writeInt(1); TextUtils.writeToParcel(mSettingsText, parcel, flags); } else { parcel.writeInt(0); } } } /** /** Loading Loading @@ -2458,6 +2486,14 @@ public class Notification implements Parcelable return mShortcutId; return mShortcutId; } } /** * Returns the settings text provided to {@link Builder#setSettingsText(CharSequence)}. */ public CharSequence getSettingsText() { return mSettingsText; } /** /** * The small icon representing this notification in the status bar and content view. * The small icon representing this notification in the status bar and content view. * * Loading Loading @@ -2886,6 +2922,24 @@ public class Notification implements Parcelable return this; return this; } } /** * Provides text that will appear as a link to your application's settings. * * <p>This text does not appear within notification {@link Style templates} but may * appear when the user uses an affordance to learn more about the notification. * Additionally, this text will not appear unless you provide a valid link target by * handling {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. * * <p>This text is meant to be concise description about what the user can customize * when they click on this link. The recommended maximum length is 40 characters. * @param text * @return */ public Builder setSettingsText(CharSequence text) { mN.mSettingsText = safeCharSequence(text); return this; } /** /** * Set the remote input history. * Set the remote input history. * * Loading packages/SystemUI/res/layout/notification_info.xml +9 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,15 @@ android:layout_height="wrap_content" android:layout_height="wrap_content" android:text="@string/notification_channel_disabled" android:text="@string/notification_channel_disabled" style="@style/TextAppearance.NotificationInfo.Secondary" /> style="@style/TextAppearance.NotificationInfo.Secondary" /> <!-- Optional link to app. Only appears if the channel is not disabled --> <TextView android:id="@+id/app_settings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:ellipsize="end" android:maxLines="1" style="@style/TextAppearance.NotificationInfo.Secondary.Link"/> </LinearLayout> </LinearLayout> <!-- Ban Channel Switch --> <!-- Ban Channel Switch --> <Switch <Switch Loading Loading
api/current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5117,6 +5117,7 @@ package android.app { method public java.lang.String getChannel(); method public java.lang.String getChannel(); method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5161,6 +5162,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5346,6 +5349,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int);
api/system-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5290,6 +5290,7 @@ package android.app { method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String); method public static java.lang.Class<? extends android.app.Notification.Style> getNotificationStyleClass(java.lang.String); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5335,6 +5336,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5522,6 +5525,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int);
api/test-current.txt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -5129,6 +5129,7 @@ package android.app { method public java.lang.String getChannel(); method public java.lang.String getChannel(); method public java.lang.String getGroup(); method public java.lang.String getGroup(); method public android.graphics.drawable.Icon getLargeIcon(); method public android.graphics.drawable.Icon getLargeIcon(); method public java.lang.CharSequence getSettingsText(); method public java.lang.String getShortcutId(); method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); method public java.lang.String getSortKey(); Loading Loading @@ -5173,6 +5174,8 @@ package android.app { field public static final java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; 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_MEDIA_SESSION = "android.mediaSession"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_MESSAGES = "android.messages"; field public static final java.lang.String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; field public static final java.lang.String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PEOPLE = "android.people"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PICTURE = "android.picture"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; field public static final java.lang.String EXTRA_PROGRESS = "android.progress"; Loading Loading @@ -5358,6 +5361,7 @@ package android.app { method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setProgress(int, int, boolean); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setPublicVersion(android.app.Notification); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setRemoteInputHistory(java.lang.CharSequence[]); method public android.app.Notification.Builder setSettingsText(java.lang.CharSequence); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShortcutId(java.lang.String); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setShowWhen(boolean); method public android.app.Notification.Builder setSmallIcon(int); method public android.app.Notification.Builder setSmallIcon(int);
core/java/android/app/Notification.java +57 −3 Original line number Original line Diff line number Diff line Loading @@ -103,8 +103,7 @@ public class Notification implements Parcelable /** /** * An activity that provides a user interface for adjusting notification preferences for its * An activity that provides a user interface for adjusting notification preferences for its * containing application. Optional but recommended for apps that post * containing application. * {@link android.app.Notification Notifications}. */ */ @SdkConstant(SdkConstantType.INTENT_CATEGORY) @SdkConstant(SdkConstantType.INTENT_CATEGORY) public static final String INTENT_CATEGORY_NOTIFICATION_PREFERENCES public static final String INTENT_CATEGORY_NOTIFICATION_PREFERENCES Loading @@ -113,10 +112,24 @@ public class Notification implements Parcelable /** /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain a {@link NotificationChannel#getId() channel id} that can be used to narrow down * contain a {@link NotificationChannel#getId() channel id} that can be used to narrow down * what in app notifications settings should be shown. * what settings should be shown in the target app. */ */ public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"; public static final String EXTRA_CHANNEL_ID = "android.intent.extra.CHANNEL_ID"; /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain the tag provided to {@link NotificationManager#notify(String, int, Notification)} * that can be used to narrow down what settings should be shown in the target app. */ public static final String EXTRA_NOTIFICATION_TAG = "android.intent.extra.NOTIFICATION_TAG"; /** * Optional extra for {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. If provided, will * contain the id provided to {@link NotificationManager#notify(String, int, Notification)} * that can be used to narrow down what settings should be shown in the target app. */ public static final String EXTRA_NOTIFICATION_ID = "android.intent.extra.NOTIFICATION_ID"; /** /** * Use all default values (where applicable). * Use all default values (where applicable). */ */ Loading Loading @@ -1082,6 +1095,7 @@ public class Notification implements Parcelable private long mTimeout; private long mTimeout; private String mShortcutId; private String mShortcutId; private CharSequence mSettingsText; /** /** * If this notification is being shown as a badge, always show as a number. * If this notification is being shown as a badge, always show as a number. Loading Loading @@ -1851,6 +1865,10 @@ public class Notification implements Parcelable } } mBadgeIcon = parcel.readInt(); mBadgeIcon = parcel.readInt(); if (parcel.readInt() != 0) { mSettingsText = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel); } } } @Override @Override Loading Loading @@ -1960,6 +1978,9 @@ public class Notification implements Parcelable that.mChannelId = this.mChannelId; that.mChannelId = this.mChannelId; that.mTimeout = this.mTimeout; that.mTimeout = this.mTimeout; that.mShortcutId = this.mShortcutId; that.mBadgeIcon = this.mBadgeIcon; that.mSettingsText = this.mSettingsText; if (!heavy) { if (!heavy) { that.lightenPayload(); // will clean out extras that.lightenPayload(); // will clean out extras Loading Loading @@ -2229,6 +2250,13 @@ public class Notification implements Parcelable } } parcel.writeInt(mBadgeIcon); parcel.writeInt(mBadgeIcon); if (mSettingsText != null) { parcel.writeInt(1); TextUtils.writeToParcel(mSettingsText, parcel, flags); } else { parcel.writeInt(0); } } } /** /** Loading Loading @@ -2458,6 +2486,14 @@ public class Notification implements Parcelable return mShortcutId; return mShortcutId; } } /** * Returns the settings text provided to {@link Builder#setSettingsText(CharSequence)}. */ public CharSequence getSettingsText() { return mSettingsText; } /** /** * The small icon representing this notification in the status bar and content view. * The small icon representing this notification in the status bar and content view. * * Loading Loading @@ -2886,6 +2922,24 @@ public class Notification implements Parcelable return this; return this; } } /** * Provides text that will appear as a link to your application's settings. * * <p>This text does not appear within notification {@link Style templates} but may * appear when the user uses an affordance to learn more about the notification. * Additionally, this text will not appear unless you provide a valid link target by * handling {@link #INTENT_CATEGORY_NOTIFICATION_PREFERENCES}. * * <p>This text is meant to be concise description about what the user can customize * when they click on this link. The recommended maximum length is 40 characters. * @param text * @return */ public Builder setSettingsText(CharSequence text) { mN.mSettingsText = safeCharSequence(text); return this; } /** /** * Set the remote input history. * Set the remote input history. * * Loading
packages/SystemUI/res/layout/notification_info.xml +9 −0 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,15 @@ android:layout_height="wrap_content" android:layout_height="wrap_content" android:text="@string/notification_channel_disabled" android:text="@string/notification_channel_disabled" style="@style/TextAppearance.NotificationInfo.Secondary" /> style="@style/TextAppearance.NotificationInfo.Secondary" /> <!-- Optional link to app. Only appears if the channel is not disabled --> <TextView android:id="@+id/app_settings" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:ellipsize="end" android:maxLines="1" style="@style/TextAppearance.NotificationInfo.Secondary.Link"/> </LinearLayout> </LinearLayout> <!-- Ban Channel Switch --> <!-- Ban Channel Switch --> <Switch <Switch Loading