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

Commit e9c76efa authored by Matías Hernández's avatar Matías Hernández Committed by Cherrypicker Worker
Browse files

Inline notification_row_user_context

Bug: 317503801
Test: atest ExpandableNotificationRowTest
Flag: ACONFIG com.android.systemui.notification_row_user_context NEXTFOOD
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:55176f645a463ad0ac3259e8330406b058104fba)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0b3ab98ca892dca961fb1bbbe98462a8c584dbcc)
Merged-In: Id07dc8feb39b08b38300ab3f73f98f602dc2a0db
Change-Id: Id07dc8feb39b08b38300ab3f73f98f602dc2a0db
24D1-dev is based on 24Q2-release. Therefore, we merged this CL to 24D1-dev.
parent bd4e5f36
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1765,10 +1765,8 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
     */
    public ExpandableNotificationRow(Context context, AttributeSet attrs) {
        this(context, attrs, context);
        if (com.android.systemui.Flags.notificationRowUserContext()) {
        Log.wtf(TAG, "This constructor shouldn't be called");
    }
    }

    /**
     * Constructs an ExpandableNotificationRow. Used by layout inflation (with a custom {@code
+1 −6
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.ImageResolver;
import com.android.internal.widget.LocalImageResolver;
import com.android.internal.widget.MessagingMessage;
import com.android.systemui.Flags;

import java.util.HashSet;
import java.util.List;
@@ -67,11 +66,7 @@ public class NotificationInlineImageResolver implements ImageResolver {
     * @param imageCache The implementation of internal cache.
     */
    public NotificationInlineImageResolver(Context context, ImageCache imageCache) {
        if (Flags.notificationRowUserContext()) {
        mContext = context;
        } else {
            mContext = context.getApplicationContext();
        }
        mImageCache = imageCache;

        if (mImageCache != null) {
+2 −3
Original line number Diff line number Diff line
@@ -60,9 +60,8 @@ public class RowInflaterTask implements InflationTask, AsyncLayoutInflater.OnInf
            mInflateOrigin = new Throwable("inflate requested here");
        }
        mListener = listener;
        AsyncLayoutInflater inflater = com.android.systemui.Flags.notificationRowUserContext()
                ? new AsyncLayoutInflater(context, new RowAsyncLayoutInflater(entry))
                : new AsyncLayoutInflater(context);
        AsyncLayoutInflater inflater = new AsyncLayoutInflater(context,
                new RowAsyncLayoutInflater(entry));
        mEntry = entry;
        entry.setInflationTask(this);
        inflater.inflate(R.layout.status_bar_notification_row, parent, this);
+0 −1
Original line number Diff line number Diff line
@@ -873,7 +873,6 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
    }

    @Test
    @EnableFlags(com.android.systemui.Flags.FLAG_NOTIFICATION_ROW_USER_CONTEXT)
    public void imageResolver_differentNotificationUser_createsUserContext() throws Exception {
        UserHandle user = new UserHandle(33);
        Context userContext = new SysuiTestableContext(mContext);
+1 −3
Original line number Diff line number Diff line
@@ -571,9 +571,7 @@ public class NotificationTestHelper {

        LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(
                Context.LAYOUT_INFLATER_SERVICE);
        if (com.android.systemui.Flags.notificationRowUserContext()) {
        inflater.setFactory2(new RowInflaterTask.RowAsyncLayoutInflater(entry));
        }
        mRow = (ExpandableNotificationRow) inflater.inflate(
                R.layout.status_bar_notification_row,
                null /* root */,