diff options
Diffstat (limited to 'core/java/android/app/Notification.java')
| -rw-r--r-- | core/java/android/app/Notification.java | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 7900fc5a69cb..45a46b302178 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -4082,16 +4082,23 @@ public class Notification implements Parcelable /** * Construct a RemoteViews for the final heads-up notification layout. + * + * @param increasedHeight true if this layout be created with an increased height. Some + * styles may support showing more then just that basic 1U size + * and the system may decide to render important notifications + * slightly bigger even when collapsed. + * + * @hide */ - public RemoteViews createHeadsUpContentView() { + public RemoteViews createHeadsUpContentView(boolean increasedHeight) { if (mN.headsUpContentView != null && (mStyle == null || !mStyle.displayCustomViewInline())) { return mN.headsUpContentView; } else if (mStyle != null) { - final RemoteViews styleView = mStyle.makeHeadsUpContentView(); - if (styleView != null) { - return styleView; - } + final RemoteViews styleView = mStyle.makeHeadsUpContentView(increasedHeight); + if (styleView != null) { + return styleView; + } } else if (mActions.size() == 0) { return null; } @@ -4100,6 +4107,13 @@ public class Notification implements Parcelable } /** + * Construct a RemoteViews for the final heads-up notification layout. + */ + public RemoteViews createHeadsUpContentView() { + return createHeadsUpContentView(false /* useIncreasedHeight */); + } + + /** * Construct a RemoteViews for the display in public contexts like on the lockscreen. * * @hide @@ -4823,9 +4837,11 @@ public class Notification implements Parcelable /** * Construct a Style-specific RemoteViews for the final HUN layout. + * + * @param increasedHeight true if this layout be created with an increased height. * @hide */ - public RemoteViews makeHeadsUpContentView() { + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { return null; } @@ -5171,6 +5187,17 @@ public class Notification implements Parcelable /** * @hide */ + @Override + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { + if (increasedHeight && mBuilder.mActions.size() > 0) { + return makeBigContentView(); + } + return super.makeHeadsUpContentView(increasedHeight); + } + + /** + * @hide + */ public RemoteViews makeBigContentView() { // Nasty @@ -5578,7 +5605,10 @@ public class Notification implements Parcelable * @hide */ @Override - public RemoteViews makeHeadsUpContentView() { + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { + if (increasedHeight) { + return makeBigContentView(); + } Message m = findLatestIncomingMessage(); CharSequence title = mConversationTitle != null ? mConversationTitle @@ -6028,7 +6058,7 @@ public class Notification implements Parcelable * @hide */ @Override - public RemoteViews makeHeadsUpContentView() { + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { RemoteViews expanded = makeMediaBigContentView(); return expanded != null ? expanded : makeMediaContentView(); } @@ -6208,7 +6238,7 @@ public class Notification implements Parcelable * @hide */ @Override - public RemoteViews makeHeadsUpContentView() { + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { return makeDecoratedHeadsUpContentView(); } @@ -6344,7 +6374,7 @@ public class Notification implements Parcelable * @hide */ @Override - public RemoteViews makeHeadsUpContentView() { + public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { RemoteViews customRemoteView = mBuilder.mN.headsUpContentView != null ? mBuilder.mN.headsUpContentView : mBuilder.mN.contentView; |
