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

Commit d2b7df08 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Create asyncImpl of setData for Messaging and Conversation Layouts"...

Merge "Create asyncImpl of setData for Messaging and Conversation Layouts" into udc-qpr-dev am: 571bf812

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24178063



Change-Id: Ibfd37b1ac84130f3d5f239dccb6991ac6ac3ac44
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 59bc599d 571bf812
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -383,7 +383,11 @@ public class ConversationLayout extends FrameLayout
        updateContentEndPaddings();
    }

    @RemotableViewMethod
    /**
     * Set conversation data
     * @param extras Bundle contains conversation data
     */
    @RemotableViewMethod(asyncImpl = "setDataAsync")
    public void setData(Bundle extras) {
        Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES);
        List<Notification.MessagingStyle.Message> newMessages
@@ -409,6 +413,18 @@ public class ConversationLayout extends FrameLayout
        setUnreadCount(unreadCount);
    }

    /**
     * RemotableViewMethod's asyncImpl of {@link #setData(Bundle)}.
     * This should be called on a background thread, and returns a Runnable which is then must be
     * called on the main thread to complete the operation and set text.
     * @param extras Bundle contains conversation data
     * @hide
     */
    @NonNull
    public Runnable setDataAsync(Bundle extras) {
        return () -> setData(extras);
    }

    @Override
    public void setImageResolver(ImageResolver resolver) {
        mImageResolver = resolver;
+17 −1
Original line number Diff line number Diff line
@@ -156,7 +156,11 @@ public class MessagingLayout extends FrameLayout
        mConversationTitle = conversationTitle;
    }

    @RemotableViewMethod
    /**
     * Set Messaging data
     * @param extras Bundle contains messaging data
     */
    @RemotableViewMethod(asyncImpl = "setDataAsync")
    public void setData(Bundle extras) {
        Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES);
        List<Notification.MessagingStyle.Message> newMessages
@@ -173,6 +177,18 @@ public class MessagingLayout extends FrameLayout
        bind(newMessages, newHistoricMessages, showSpinner);
    }

    /**
     * RemotableViewMethod's asyncImpl of {@link #setData(Bundle)}.
     * This should be called on a background thread, and returns a Runnable which is then must be
     * called on the main thread to complete the operation and set text.
     * @param extras Bundle contains messaging data
     * @hide
     */
    @NonNull
    public Runnable setDataAsync(Bundle extras) {
        return () -> setData(extras);
    }

    @Override
    public void setImageResolver(ImageResolver resolver) {
        mImageResolver = resolver;