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

Commit 002f7cc9 authored by Rahul Banerjee's avatar Rahul Banerjee
Browse files

Fixes for notification_row_transparency.

Bug: 392187268
Test: atest ActivatableNotificationViewTest
Flag: com.android.systemui.notification_row_transparency
Change-Id: If7899ba352e5295ad6c0038a33b817fc4374694c
parent fe47d228
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ import android.testing.TestableLooper.RunWithLooper
import android.view.View
import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.filters.SmallTest
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.SysuiTestCase
import com.android.systemui.res.R
import com.android.systemui.res.R
import com.android.systemui.statusbar.notification.FakeShadowView
import com.android.systemui.statusbar.notification.FakeShadowView
@@ -69,6 +70,9 @@ class ActivatableNotificationViewTest : SysuiTestCase() {
    fun testBackgroundBehaviors() {
    fun testBackgroundBehaviors() {
        // Color starts with the normal color
        // Color starts with the normal color
        mView.updateBackgroundColors()
        mView.updateBackgroundColors()
        if (Flags.notificationRowTransparency()) {
            mNormalColor = mView.currentBackgroundTint
        }
        assertThat(mView.currentBackgroundTint).isEqualTo(mNormalColor)
        assertThat(mView.currentBackgroundTint).isEqualTo(mNormalColor)


        // Setting a tint changes the background to that color specifically
        // Setting a tint changes the background to that color specifically
+9 −1
Original line number Original line Diff line number Diff line
@@ -51,6 +51,7 @@ import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.os.UserHandle;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.EnableFlags;
import android.service.notification.StatusBarNotification;
import android.testing.TestableLooper;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.DisplayMetrics;
import android.util.DisplayMetrics;
@@ -984,10 +985,17 @@ public class ExpandableNotificationRowTest extends SysuiTestCase {
    public void isExpanded_promotedNotificationAllowOnKeyguard_expanded() throws Exception {
    public void isExpanded_promotedNotificationAllowOnKeyguard_expanded() throws Exception {
        // GIVEN
        // GIVEN
        final ExpandableNotificationRow row = mNotificationTestHelper.createRow();
        final ExpandableNotificationRow row = mNotificationTestHelper.createRow();
        final StatusBarNotification sbn = mock(StatusBarNotification.class);
        final Notification notification = mock(Notification.class);

        NotificationEntry entry = mock(NotificationEntry.class);
        NotificationEntry entry = mock(NotificationEntry.class);
        when(entry.getSbn()).thenReturn(sbn);
        when(sbn.getNotification()).thenReturn(notification);
        when(notification.isColorized()).thenReturn(false);

        when(entry.isPromotedOngoing()).thenReturn(true);
        when(entry.isPromotedOngoing()).thenReturn(true);
        row.setEntryLegacy(entry);
        setRowPromotedOngoing(row);
        setRowPromotedOngoing(row);
        row.setEntryLegacy(entry);
        row.setOnKeyguard(true);
        row.setOnKeyguard(true);


        // THEN
        // THEN