Loading core/java/android/app/Notification.java +40 −10 Original line number Diff line number Diff line Loading @@ -4082,13 +4082,20 @@ 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(); final RemoteViews styleView = mStyle.makeHeadsUpContentView(increasedHeight); if (styleView != null) { return styleView; } Loading @@ -4099,6 +4106,13 @@ public class Notification implements Parcelable return applyStandardTemplateWithActions(getBigBaseLayoutResource()); } /** * 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. * Loading Loading @@ -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; } Loading Loading @@ -5168,6 +5184,17 @@ public class Notification implements Parcelable return super.makeContentView(increasedHeight); } /** * @hide */ @Override public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { if (increasedHeight && mBuilder.mActions.size() > 0) { return makeBigContentView(); } return super.makeHeadsUpContentView(increasedHeight); } /** * @hide */ Loading Loading @@ -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 Loading Loading @@ -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(); } Loading Loading @@ -6208,7 +6238,7 @@ public class Notification implements Parcelable * @hide */ @Override public RemoteViews makeHeadsUpContentView() { public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { return makeDecoratedHeadsUpContentView(); } Loading Loading @@ -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; Loading packages/SystemUI/res/values/dimens.xml +5 −2 Original line number Diff line number Diff line Loading @@ -69,8 +69,8 @@ <!-- Height of a small notification in the status bar--> <dimen name="notification_min_height">92dp</dimen> <!-- Height of a small notification in the status bar if it is a large (like messaging)--> <dimen name="notification_min_height_large">132dp</dimen> <!-- Increased height of a small notification in the status bar --> <dimen name="notification_min_height_increased">132dp</dimen> <!-- Height of a small notification in the status bar which was used before android N --> <dimen name="notification_min_height_legacy">64dp</dimen> Loading @@ -87,6 +87,9 @@ <!-- Height of a heads up notification in the status bar --> <dimen name="notification_max_heads_up_height">148dp</dimen> <!-- Height of a heads up notification in the status bar --> <dimen name="notification_max_heads_up_height_increased">188dp</dimen> <!-- a threshold in dp per second that is considered fast scrolling --> <dimen name="scroll_fast_threshold">1500dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +17 −3 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private int mNotificationMinHeightLegacy; private int mMaxHeadsUpHeightLegacy; private int mMaxHeadsUpHeight; private int mMaxHeadsUpHeightIncreased; private int mNotificationMinHeight; private int mNotificationMinHeightLarge; private int mNotificationMaxHeight; Loading Loading @@ -209,6 +210,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mIsLowPriority; private boolean mIsColorized; private boolean mUseIncreasedCollapsedHeight; private boolean mUseIncreasedHeadsUpHeight; @Override public boolean isGroupExpansionChanging() { Loading Loading @@ -354,8 +356,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { boolean headsUpCustom = layout.getHeadsUpChild() != null && layout.getHeadsUpChild().getId() != com.android.internal.R.id.status_bar_latest_event_content; int headsUpheight = headsUpCustom && beforeN ? mMaxHeadsUpHeightLegacy : mMaxHeadsUpHeight; int headsUpheight; if (headsUpCustom && beforeN) { headsUpheight = mMaxHeadsUpHeightLegacy; } else if (mUseIncreasedHeadsUpHeight && layout == mPrivateLayout) { headsUpheight = mMaxHeadsUpHeightIncreased; } else { headsUpheight = mMaxHeadsUpHeight; } layout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight, mNotificationAmbientHeight); } Loading Loading @@ -991,6 +999,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mUseIncreasedCollapsedHeight = use; } public void setUseIncreasedHeadsUpHeight(boolean use) { mUseIncreasedHeadsUpHeight = use; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading @@ -1005,12 +1017,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mNotificationMinHeightLegacy = getFontScaledHeight(R.dimen.notification_min_height_legacy); mNotificationMinHeight = getFontScaledHeight(R.dimen.notification_min_height); mNotificationMinHeightLarge = getFontScaledHeight( R.dimen.notification_min_height_large); R.dimen.notification_min_height_increased); mNotificationMaxHeight = getFontScaledHeight(R.dimen.notification_max_height); mNotificationAmbientHeight = getFontScaledHeight(R.dimen.notification_ambient_height); mMaxHeadsUpHeightLegacy = getFontScaledHeight( R.dimen.notification_max_heads_up_height_legacy); mMaxHeadsUpHeight = getFontScaledHeight(R.dimen.notification_max_heads_up_height); mMaxHeadsUpHeightIncreased = getFontScaledHeight( R.dimen.notification_max_heads_up_height_increased); mIncreasedPaddingBetweenElements = getResources() .getDimensionPixelSize(R.dimen.notification_divider_height_increased); mIconTransformContentShiftNoIcon = getResources().getDimensionPixelSize( Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +4 −3 Original line number Diff line number Diff line Loading @@ -126,7 +126,8 @@ public class NotificationData { } public boolean cacheContentViews(Context ctx, Notification updatedNotification, boolean isLowPriority, boolean useIncreasedCollapsedView) { boolean isLowPriority, boolean useIncreasedCollapsedView, boolean useIncreasedHeadsUp) { boolean applyInPlace = false; if (updatedNotification != null) { final Notification.Builder updatedNotificationBuilder Loading @@ -136,7 +137,7 @@ public class NotificationData { final RemoteViews newBigContentView = createBigContentView( updatedNotificationBuilder, isLowPriority); final RemoteViews newHeadsUpContentView = updatedNotificationBuilder.createHeadsUpContentView(); updatedNotificationBuilder.createHeadsUpContentView(useIncreasedHeadsUp); final RemoteViews newPublicNotification = updatedNotificationBuilder.makePublicContentView(); final RemoteViews newAmbientNotification Loading Loading @@ -165,7 +166,7 @@ public class NotificationData { cachedContentView = createContentView(builder, isLowPriority, useIncreasedCollapsedView); cachedBigContentView = createBigContentView(builder, isLowPriority); cachedHeadsUpContentView = builder.createHeadsUpContentView(); cachedHeadsUpContentView = builder.createHeadsUpContentView(useIncreasedHeadsUp); cachedPublicContentView = builder.makePublicContentView(); cachedAmbientContentView = builder.makeAmbientNotification(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +10 −2 Original line number Diff line number Diff line Loading @@ -712,6 +712,7 @@ public class StatusBar extends SystemUI implements DemoMode, private NetworkController mNetworkController; private KeyguardMonitorImpl mKeyguardMonitor; private BatteryController mBatteryController; private boolean mPanelExpanded; private LogMaker mStatusBarStateLog; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private NotificationIconAreaController mNotificationIconAreaController; Loading Loading @@ -2679,6 +2680,7 @@ public class StatusBar extends SystemUI implements DemoMode, } public void setPanelExpanded(boolean isExpanded) { mPanelExpanded = isExpanded; mStatusBarWindowManager.setPanelExpanded(isExpanded); mVisualStabilityManager.setPanelExpanded(isExpanded); if (isExpanded && getBarState() != StatusBarState.KEYGUARD) { Loading Loading @@ -6094,8 +6096,10 @@ public class StatusBar extends SystemUI implements DemoMode, boolean isLowPriority = mNotificationData.isAmbient(sbn.getKey()); boolean useIncreasedCollapsedHeight = mMessagingUtil.isImportantMessaging(sbn, mNotificationData.getImportance(sbn.getKey())); boolean useIncreasedHeadsUp = useIncreasedCollapsedHeight && mPanelExpanded; try { entry.cacheContentViews(mContext, null, isLowPriority, useIncreasedCollapsedHeight); entry.cacheContentViews(mContext, null, isLowPriority, useIncreasedCollapsedHeight, useIncreasedHeadsUp); } catch (RuntimeException e) { Log.e(TAG, "Unable to get notification remote views", e); return false; Loading Loading @@ -6266,6 +6270,7 @@ public class StatusBar extends SystemUI implements DemoMode, } row.setUserLocked(userLocked); row.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); row.setUseIncreasedHeadsUpHeight(useIncreasedHeadsUp); row.onNotificationUpdated(entry); return true; } Loading Loading @@ -6760,10 +6765,13 @@ public class StatusBar extends SystemUI implements DemoMode, boolean useIncreasedCollapsedHeight = mMessagingUtil.isImportantMessaging(notification, mNotificationData.getImportance(notification.getKey())); entry.row.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); boolean useIncreasedHeadsUp = useIncreasedCollapsedHeight && mPanelExpanded; entry.row.setUseIncreasedHeadsUpHeight(useIncreasedHeadsUp); boolean applyInPlace; try { applyInPlace = entry.cacheContentViews(mContext, notification.getNotification(), mNotificationData.isAmbient(key), useIncreasedCollapsedHeight); mNotificationData.isAmbient(key), useIncreasedCollapsedHeight, useIncreasedHeadsUp); } catch (RuntimeException e) { Log.e(TAG, "Unable to get notification remote views", e); applyInPlace = false; Loading Loading
core/java/android/app/Notification.java +40 −10 Original line number Diff line number Diff line Loading @@ -4082,13 +4082,20 @@ 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(); final RemoteViews styleView = mStyle.makeHeadsUpContentView(increasedHeight); if (styleView != null) { return styleView; } Loading @@ -4099,6 +4106,13 @@ public class Notification implements Parcelable return applyStandardTemplateWithActions(getBigBaseLayoutResource()); } /** * 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. * Loading Loading @@ -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; } Loading Loading @@ -5168,6 +5184,17 @@ public class Notification implements Parcelable return super.makeContentView(increasedHeight); } /** * @hide */ @Override public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { if (increasedHeight && mBuilder.mActions.size() > 0) { return makeBigContentView(); } return super.makeHeadsUpContentView(increasedHeight); } /** * @hide */ Loading Loading @@ -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 Loading Loading @@ -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(); } Loading Loading @@ -6208,7 +6238,7 @@ public class Notification implements Parcelable * @hide */ @Override public RemoteViews makeHeadsUpContentView() { public RemoteViews makeHeadsUpContentView(boolean increasedHeight) { return makeDecoratedHeadsUpContentView(); } Loading Loading @@ -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; Loading
packages/SystemUI/res/values/dimens.xml +5 −2 Original line number Diff line number Diff line Loading @@ -69,8 +69,8 @@ <!-- Height of a small notification in the status bar--> <dimen name="notification_min_height">92dp</dimen> <!-- Height of a small notification in the status bar if it is a large (like messaging)--> <dimen name="notification_min_height_large">132dp</dimen> <!-- Increased height of a small notification in the status bar --> <dimen name="notification_min_height_increased">132dp</dimen> <!-- Height of a small notification in the status bar which was used before android N --> <dimen name="notification_min_height_legacy">64dp</dimen> Loading @@ -87,6 +87,9 @@ <!-- Height of a heads up notification in the status bar --> <dimen name="notification_max_heads_up_height">148dp</dimen> <!-- Height of a heads up notification in the status bar --> <dimen name="notification_max_heads_up_height_increased">188dp</dimen> <!-- a threshold in dp per second that is considered fast scrolling --> <dimen name="scroll_fast_threshold">1500dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +17 −3 Original line number Diff line number Diff line Loading @@ -76,6 +76,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private int mNotificationMinHeightLegacy; private int mMaxHeadsUpHeightLegacy; private int mMaxHeadsUpHeight; private int mMaxHeadsUpHeightIncreased; private int mNotificationMinHeight; private int mNotificationMinHeightLarge; private int mNotificationMaxHeight; Loading Loading @@ -209,6 +210,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { private boolean mIsLowPriority; private boolean mIsColorized; private boolean mUseIncreasedCollapsedHeight; private boolean mUseIncreasedHeadsUpHeight; @Override public boolean isGroupExpansionChanging() { Loading Loading @@ -354,8 +356,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { boolean headsUpCustom = layout.getHeadsUpChild() != null && layout.getHeadsUpChild().getId() != com.android.internal.R.id.status_bar_latest_event_content; int headsUpheight = headsUpCustom && beforeN ? mMaxHeadsUpHeightLegacy : mMaxHeadsUpHeight; int headsUpheight; if (headsUpCustom && beforeN) { headsUpheight = mMaxHeadsUpHeightLegacy; } else if (mUseIncreasedHeadsUpHeight && layout == mPrivateLayout) { headsUpheight = mMaxHeadsUpHeightIncreased; } else { headsUpheight = mMaxHeadsUpHeight; } layout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight, mNotificationAmbientHeight); } Loading Loading @@ -991,6 +999,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mUseIncreasedCollapsedHeight = use; } public void setUseIncreasedHeadsUpHeight(boolean use) { mUseIncreasedHeadsUpHeight = use; } public interface ExpansionLogger { public void logNotificationExpansion(String key, boolean userAction, boolean expanded); } Loading @@ -1005,12 +1017,14 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { mNotificationMinHeightLegacy = getFontScaledHeight(R.dimen.notification_min_height_legacy); mNotificationMinHeight = getFontScaledHeight(R.dimen.notification_min_height); mNotificationMinHeightLarge = getFontScaledHeight( R.dimen.notification_min_height_large); R.dimen.notification_min_height_increased); mNotificationMaxHeight = getFontScaledHeight(R.dimen.notification_max_height); mNotificationAmbientHeight = getFontScaledHeight(R.dimen.notification_ambient_height); mMaxHeadsUpHeightLegacy = getFontScaledHeight( R.dimen.notification_max_heads_up_height_legacy); mMaxHeadsUpHeight = getFontScaledHeight(R.dimen.notification_max_heads_up_height); mMaxHeadsUpHeightIncreased = getFontScaledHeight( R.dimen.notification_max_heads_up_height_increased); mIncreasedPaddingBetweenElements = getResources() .getDimensionPixelSize(R.dimen.notification_divider_height_increased); mIconTransformContentShiftNoIcon = getResources().getDimensionPixelSize( Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +4 −3 Original line number Diff line number Diff line Loading @@ -126,7 +126,8 @@ public class NotificationData { } public boolean cacheContentViews(Context ctx, Notification updatedNotification, boolean isLowPriority, boolean useIncreasedCollapsedView) { boolean isLowPriority, boolean useIncreasedCollapsedView, boolean useIncreasedHeadsUp) { boolean applyInPlace = false; if (updatedNotification != null) { final Notification.Builder updatedNotificationBuilder Loading @@ -136,7 +137,7 @@ public class NotificationData { final RemoteViews newBigContentView = createBigContentView( updatedNotificationBuilder, isLowPriority); final RemoteViews newHeadsUpContentView = updatedNotificationBuilder.createHeadsUpContentView(); updatedNotificationBuilder.createHeadsUpContentView(useIncreasedHeadsUp); final RemoteViews newPublicNotification = updatedNotificationBuilder.makePublicContentView(); final RemoteViews newAmbientNotification Loading Loading @@ -165,7 +166,7 @@ public class NotificationData { cachedContentView = createContentView(builder, isLowPriority, useIncreasedCollapsedView); cachedBigContentView = createBigContentView(builder, isLowPriority); cachedHeadsUpContentView = builder.createHeadsUpContentView(); cachedHeadsUpContentView = builder.createHeadsUpContentView(useIncreasedHeadsUp); cachedPublicContentView = builder.makePublicContentView(); cachedAmbientContentView = builder.makeAmbientNotification(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +10 −2 Original line number Diff line number Diff line Loading @@ -712,6 +712,7 @@ public class StatusBar extends SystemUI implements DemoMode, private NetworkController mNetworkController; private KeyguardMonitorImpl mKeyguardMonitor; private BatteryController mBatteryController; private boolean mPanelExpanded; private LogMaker mStatusBarStateLog; private LockscreenGestureLogger mLockscreenGestureLogger = new LockscreenGestureLogger(); private NotificationIconAreaController mNotificationIconAreaController; Loading Loading @@ -2679,6 +2680,7 @@ public class StatusBar extends SystemUI implements DemoMode, } public void setPanelExpanded(boolean isExpanded) { mPanelExpanded = isExpanded; mStatusBarWindowManager.setPanelExpanded(isExpanded); mVisualStabilityManager.setPanelExpanded(isExpanded); if (isExpanded && getBarState() != StatusBarState.KEYGUARD) { Loading Loading @@ -6094,8 +6096,10 @@ public class StatusBar extends SystemUI implements DemoMode, boolean isLowPriority = mNotificationData.isAmbient(sbn.getKey()); boolean useIncreasedCollapsedHeight = mMessagingUtil.isImportantMessaging(sbn, mNotificationData.getImportance(sbn.getKey())); boolean useIncreasedHeadsUp = useIncreasedCollapsedHeight && mPanelExpanded; try { entry.cacheContentViews(mContext, null, isLowPriority, useIncreasedCollapsedHeight); entry.cacheContentViews(mContext, null, isLowPriority, useIncreasedCollapsedHeight, useIncreasedHeadsUp); } catch (RuntimeException e) { Log.e(TAG, "Unable to get notification remote views", e); return false; Loading Loading @@ -6266,6 +6270,7 @@ public class StatusBar extends SystemUI implements DemoMode, } row.setUserLocked(userLocked); row.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); row.setUseIncreasedHeadsUpHeight(useIncreasedHeadsUp); row.onNotificationUpdated(entry); return true; } Loading Loading @@ -6760,10 +6765,13 @@ public class StatusBar extends SystemUI implements DemoMode, boolean useIncreasedCollapsedHeight = mMessagingUtil.isImportantMessaging(notification, mNotificationData.getImportance(notification.getKey())); entry.row.setUseIncreasedCollapsedHeight(useIncreasedCollapsedHeight); boolean useIncreasedHeadsUp = useIncreasedCollapsedHeight && mPanelExpanded; entry.row.setUseIncreasedHeadsUpHeight(useIncreasedHeadsUp); boolean applyInPlace; try { applyInPlace = entry.cacheContentViews(mContext, notification.getNotification(), mNotificationData.isAmbient(key), useIncreasedCollapsedHeight); mNotificationData.isAmbient(key), useIncreasedCollapsedHeight, useIncreasedHeadsUp); } catch (RuntimeException e) { Log.e(TAG, "Unable to get notification remote views", e); applyInPlace = false; Loading