Loading api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5052,6 +5052,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5318,9 +5319,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence); api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5212,6 +5212,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5480,9 +5481,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence); api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5062,6 +5062,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5328,9 +5329,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence); core/java/android/app/Notification.java +77 −8 Original line number Diff line number Diff line Loading @@ -971,6 +971,15 @@ public class Notification implements Parcelable */ public static final String EXTRA_MESSAGES = "android.messages"; /** * {@link #extras} key: an array of * {@link android.app.Notification.MessagingStyle#addHistoricMessage historic} * {@link android.app.Notification.MessagingStyle.Message} bundles provided by a * {@link android.app.Notification.MessagingStyle} notification. This extra is a parcelable * array of bundles. */ public static final String EXTRA_HISTORIC_MESSAGES = "android.messages.historic"; /** * {@link #extras} key: the user that built the notification. * Loading Loading @@ -4809,6 +4818,7 @@ public class Notification implements Parcelable CharSequence mUserDisplayName; CharSequence mConversationTitle; List<Message> mMessages = new ArrayList<>(); List<Message> mHistoricMessages = new ArrayList<>(); MessagingStyle() { } Loading Loading @@ -4865,15 +4875,15 @@ public class Notification implements Parcelable * @return this object for method chaining */ public MessagingStyle addMessage(CharSequence text, long timestamp, CharSequence sender) { mMessages.add(new Message(text, timestamp, sender)); if (mMessages.size() > MAXIMUM_RETAINED_MESSAGES) { mMessages.remove(0); } return this; return addMessage(new Message(text, timestamp, sender)); } /** * Adds a {@link Message} for display in this notification. * * <p>The messages should be added in chronologic order, i.e. the oldest first, * the newest last. * * @param message The {@link Message} to be displayed * @return this object for method chaining */ Loading @@ -4885,6 +4895,27 @@ public class Notification implements Parcelable return this; } /** * Adds a {@link Message} for historic context in this notification. * * <p>Messages should be added as historic if they are not the main subject of the * notification but may give context to a conversation. The system may choose to present * them only when relevant, e.g. when replying to a message through a {@link RemoteInput}. * * <p>The messages should be added in chronologic order, i.e. the oldest first, * the newest last. * * @param message The historic {@link Message} to be added * @return this object for method chaining */ public MessagingStyle addHistoricMessage(Message message) { mHistoricMessages.add(message); if (mHistoricMessages.size() > MAXIMUM_RETAINED_MESSAGES) { mHistoricMessages.remove(0); } return this; } /** * Gets the list of {@code Message} objects that represent the notification */ Loading @@ -4892,6 +4923,13 @@ public class Notification implements Parcelable return mMessages; } /** * Gets the list of historic {@code Message}s in the notification. */ public List<Message> getHistoricMessages() { return mHistoricMessages; } /** * @hide */ Loading @@ -4907,6 +4945,9 @@ public class Notification implements Parcelable if (!mMessages.isEmpty()) { extras.putParcelableArray(EXTRA_MESSAGES, Message.getBundleArrayForMessages(mMessages)); } if (!mHistoricMessages.isEmpty()) { extras.putParcelableArray(EXTRA_HISTORIC_MESSAGES, Message.getBundleArrayForMessages(mHistoricMessages)); } fixTitleAndTextExtras(extras); } Loading Loading @@ -4946,11 +4987,16 @@ public class Notification implements Parcelable super.restoreFromExtras(extras); mMessages.clear(); mHistoricMessages.clear(); mUserDisplayName = extras.getCharSequence(EXTRA_SELF_DISPLAY_NAME); mConversationTitle = extras.getCharSequence(EXTRA_CONVERSATION_TITLE); Parcelable[] parcelables = extras.getParcelableArray(EXTRA_MESSAGES); if (parcelables != null && parcelables instanceof Parcelable[]) { mMessages = Message.getMessagesFromBundleArray(parcelables); Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (messages != null && messages instanceof Parcelable[]) { mMessages = Message.getMessagesFromBundleArray(messages); } Parcelable[] histMessages = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (histMessages != null && histMessages instanceof Parcelable[]) { mHistoricMessages = Message.getMessagesFromBundleArray(histMessages); } } Loading Loading @@ -5035,6 +5081,21 @@ public class Notification implements Parcelable int contractedChildId = View.NO_ID; Message contractedMessage = findLatestIncomingMessage(); int firstHistoricMessage = Math.max(0, mHistoricMessages.size() - (rowIds.length - mMessages.size())); while (firstHistoricMessage + i < mHistoricMessages.size() && i < rowIds.length) { Message m = mHistoricMessages.get(firstHistoricMessage + i); int rowId = rowIds[i]; contentView.setTextViewText(rowId, makeMessageLine(m)); if (contractedMessage == m) { contractedChildId = rowId; } i++; } int firstMessage = Math.max(0, mMessages.size() - rowIds.length); while (firstMessage + i < mMessages.size() && i < rowIds.length) { Message m = mMessages.get(firstMessage + i); Loading @@ -5049,6 +5110,14 @@ public class Notification implements Parcelable i++; } // Clear the remaining views for reapply. Ensures that historic message views can // reliably be identified as being GONE and having non-null text. while (i < rowIds.length) { int rowId = rowIds[i]; contentView.setTextViewText(rowId, null); i++; } // Record this here to allow transformation between the contracted and expanded views. contentView.setInt(R.id.notification_messaging, "setContractedChildId", contractedChildId); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMessagingTemplateViewWrapper.java +10 −5 Original line number Diff line number Diff line Loading @@ -44,11 +44,16 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla && ((MessagingLinearLayout) container).getChildCount() > 0) { MessagingLinearLayout messagingContainer = (MessagingLinearLayout) container; // Only consider the first child - transforming to a position other than the first // looks bad because we have to move across other messages that are fading in. View child = messagingContainer.getChildAt(0); // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. int childCount = messagingContainer.getChildCount(); for (int i = 0; i < childCount; i++) { View child = messagingContainer.getChildAt(i); if (child.getId() == messagingContainer.getContractedChildId()) { mContractedMessage = child; } else if (child.getVisibility() == View.VISIBLE) { break; } } } } Loading Loading
api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5052,6 +5052,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5318,9 +5319,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence);
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5212,6 +5212,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5480,9 +5481,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence);
api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -5062,6 +5062,7 @@ package android.app { field public static final java.lang.String EXTRA_CHRONOMETER_COUNT_DOWN = "android.chronometerCountDown"; field public static final java.lang.String EXTRA_COMPACT_ACTIONS = "android.compactActions"; 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 java.lang.String EXTRA_LARGE_ICON_BIG = "android.largeIcon.big"; Loading Loading @@ -5328,9 +5329,11 @@ package android.app { public static class Notification.MessagingStyle extends android.app.Notification.Style { ctor public Notification.MessagingStyle(java.lang.CharSequence); method public android.app.Notification.MessagingStyle addHistoricMessage(android.app.Notification.MessagingStyle.Message); method public android.app.Notification.MessagingStyle addMessage(java.lang.CharSequence, long, java.lang.CharSequence); method public android.app.Notification.MessagingStyle addMessage(android.app.Notification.MessagingStyle.Message); method public java.lang.CharSequence getConversationTitle(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getHistoricMessages(); method public java.util.List<android.app.Notification.MessagingStyle.Message> getMessages(); method public java.lang.CharSequence getUserDisplayName(); method public android.app.Notification.MessagingStyle setConversationTitle(java.lang.CharSequence);
core/java/android/app/Notification.java +77 −8 Original line number Diff line number Diff line Loading @@ -971,6 +971,15 @@ public class Notification implements Parcelable */ public static final String EXTRA_MESSAGES = "android.messages"; /** * {@link #extras} key: an array of * {@link android.app.Notification.MessagingStyle#addHistoricMessage historic} * {@link android.app.Notification.MessagingStyle.Message} bundles provided by a * {@link android.app.Notification.MessagingStyle} notification. This extra is a parcelable * array of bundles. */ public static final String EXTRA_HISTORIC_MESSAGES = "android.messages.historic"; /** * {@link #extras} key: the user that built the notification. * Loading Loading @@ -4809,6 +4818,7 @@ public class Notification implements Parcelable CharSequence mUserDisplayName; CharSequence mConversationTitle; List<Message> mMessages = new ArrayList<>(); List<Message> mHistoricMessages = new ArrayList<>(); MessagingStyle() { } Loading Loading @@ -4865,15 +4875,15 @@ public class Notification implements Parcelable * @return this object for method chaining */ public MessagingStyle addMessage(CharSequence text, long timestamp, CharSequence sender) { mMessages.add(new Message(text, timestamp, sender)); if (mMessages.size() > MAXIMUM_RETAINED_MESSAGES) { mMessages.remove(0); } return this; return addMessage(new Message(text, timestamp, sender)); } /** * Adds a {@link Message} for display in this notification. * * <p>The messages should be added in chronologic order, i.e. the oldest first, * the newest last. * * @param message The {@link Message} to be displayed * @return this object for method chaining */ Loading @@ -4885,6 +4895,27 @@ public class Notification implements Parcelable return this; } /** * Adds a {@link Message} for historic context in this notification. * * <p>Messages should be added as historic if they are not the main subject of the * notification but may give context to a conversation. The system may choose to present * them only when relevant, e.g. when replying to a message through a {@link RemoteInput}. * * <p>The messages should be added in chronologic order, i.e. the oldest first, * the newest last. * * @param message The historic {@link Message} to be added * @return this object for method chaining */ public MessagingStyle addHistoricMessage(Message message) { mHistoricMessages.add(message); if (mHistoricMessages.size() > MAXIMUM_RETAINED_MESSAGES) { mHistoricMessages.remove(0); } return this; } /** * Gets the list of {@code Message} objects that represent the notification */ Loading @@ -4892,6 +4923,13 @@ public class Notification implements Parcelable return mMessages; } /** * Gets the list of historic {@code Message}s in the notification. */ public List<Message> getHistoricMessages() { return mHistoricMessages; } /** * @hide */ Loading @@ -4907,6 +4945,9 @@ public class Notification implements Parcelable if (!mMessages.isEmpty()) { extras.putParcelableArray(EXTRA_MESSAGES, Message.getBundleArrayForMessages(mMessages)); } if (!mHistoricMessages.isEmpty()) { extras.putParcelableArray(EXTRA_HISTORIC_MESSAGES, Message.getBundleArrayForMessages(mHistoricMessages)); } fixTitleAndTextExtras(extras); } Loading Loading @@ -4946,11 +4987,16 @@ public class Notification implements Parcelable super.restoreFromExtras(extras); mMessages.clear(); mHistoricMessages.clear(); mUserDisplayName = extras.getCharSequence(EXTRA_SELF_DISPLAY_NAME); mConversationTitle = extras.getCharSequence(EXTRA_CONVERSATION_TITLE); Parcelable[] parcelables = extras.getParcelableArray(EXTRA_MESSAGES); if (parcelables != null && parcelables instanceof Parcelable[]) { mMessages = Message.getMessagesFromBundleArray(parcelables); Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES); if (messages != null && messages instanceof Parcelable[]) { mMessages = Message.getMessagesFromBundleArray(messages); } Parcelable[] histMessages = extras.getParcelableArray(EXTRA_HISTORIC_MESSAGES); if (histMessages != null && histMessages instanceof Parcelable[]) { mHistoricMessages = Message.getMessagesFromBundleArray(histMessages); } } Loading Loading @@ -5035,6 +5081,21 @@ public class Notification implements Parcelable int contractedChildId = View.NO_ID; Message contractedMessage = findLatestIncomingMessage(); int firstHistoricMessage = Math.max(0, mHistoricMessages.size() - (rowIds.length - mMessages.size())); while (firstHistoricMessage + i < mHistoricMessages.size() && i < rowIds.length) { Message m = mHistoricMessages.get(firstHistoricMessage + i); int rowId = rowIds[i]; contentView.setTextViewText(rowId, makeMessageLine(m)); if (contractedMessage == m) { contractedChildId = rowId; } i++; } int firstMessage = Math.max(0, mMessages.size() - rowIds.length); while (firstMessage + i < mMessages.size() && i < rowIds.length) { Message m = mMessages.get(firstMessage + i); Loading @@ -5049,6 +5110,14 @@ public class Notification implements Parcelable i++; } // Clear the remaining views for reapply. Ensures that historic message views can // reliably be identified as being GONE and having non-null text. while (i < rowIds.length) { int rowId = rowIds[i]; contentView.setTextViewText(rowId, null); i++; } // Record this here to allow transformation between the contracted and expanded views. contentView.setInt(R.id.notification_messaging, "setContractedChildId", contractedChildId); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationMessagingTemplateViewWrapper.java +10 −5 Original line number Diff line number Diff line Loading @@ -44,11 +44,16 @@ public class NotificationMessagingTemplateViewWrapper extends NotificationTempla && ((MessagingLinearLayout) container).getChildCount() > 0) { MessagingLinearLayout messagingContainer = (MessagingLinearLayout) container; // Only consider the first child - transforming to a position other than the first // looks bad because we have to move across other messages that are fading in. View child = messagingContainer.getChildAt(0); // Only consider the first visible child - transforming to a position other than the // first looks bad because we have to move across other messages that are fading in. int childCount = messagingContainer.getChildCount(); for (int i = 0; i < childCount; i++) { View child = messagingContainer.getChildAt(i); if (child.getId() == messagingContainer.getContractedChildId()) { mContractedMessage = child; } else if (child.getVisibility() == View.VISIBLE) { break; } } } } Loading