Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3df6df00 authored by Jeff DeCew's avatar Jeff DeCew
Browse files

Make the fallback nature of message text clear from the docs.

Notification.MessagingStyle.Message.text has always been used on handheld as the non-displayed alt-text of images, and should be explicitly represented that way in the API.

Change-Id: Ib122657d3ceeeb3f7a3238ba65feddf6463f5163
Fixes: 341964094
Flag: DOCS_ONLY
Test: n/a
parent 5dd37854
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -8725,6 +8725,12 @@ public class Notification implements Parcelable
         * <p>The messages should be added in chronologic order, i.e. the oldest first,
         * the newest last.
         *
         * <p>Multiple Messages in a row with the same timestamp and sender may be grouped as a
         * single message. This means an app should represent a message that has both an image and
         * text as two Message objects, one with the image (and fallback text), and the other with
         * the message text. For consistency, a text message (if any) should be provided after Uri
         * content.
         *
         * @param message The {@link Message} to be displayed
         * @return this object for method chaining
         */
@@ -9359,6 +9365,15 @@ public class Notification implements Parcelable
            }
        }
        /*
         * An object representing a simple message or piece of media within a mixed-media message.
         *
         * This object can only represent text or a single binary piece of media. For apps which
         * support mixed-media messages (e.g. text + image), multiple Messages should be used, one
         * to represent each piece of the message, and they should all be given the same timestamp.
         * For consistency, a text message should be added last of all Messages with the same
         * timestamp.
         */
        public static final class Message {
            /** @hide */
            public static final String KEY_TEXT = "text";
@@ -9447,8 +9462,9 @@ public class Notification implements Parcelable
            /**
             * Sets a binary blob of data and an associated MIME type for a message. In the case
             * where the platform doesn't support the MIME type, the original text provided in the
             * constructor will be used.
             * where the platform or the UI state doesn't support the MIME type, the original text
             * provided in the constructor will be used.  When this data can be presented to the
             * user, the original text will only be used as accessibility text.
             * @param dataMimeType The MIME type of the content. See
             * {@link android.graphics.ImageDecoder#isMimeTypeSupported(String)} for a list of
             * supported image MIME types.