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

Commit 179d079d authored by Evan Laird's avatar Evan Laird
Browse files

[Ongoing call] Don't animate hide of notifs when showing chip

Animating the hide animation for the notification icons while showing
the ongoing call chip causes an unnecessary (and unnecessarily bad)
animation as the icons are hiding _and_ translating

This change uses a no-animate strategy for the hide animation of the
notification icons. Thus, we no longer have clashing animations running
and it looks better.

Test: manual
Test: CollapsedStatusBarFragmentTest
Flag: NONE
Fixes: 302168270
Change-Id: I4bcf2f7cb3532a565eb1e64e6d854ec2c802576a
parent 6e8dc3c4
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -86,6 +86,8 @@ import com.android.systemui.util.CarrierConfigTracker.CarrierConfigChangedListen
import com.android.systemui.util.CarrierConfigTracker.DefaultDataSubscriptionChangedListener;
import com.android.systemui.util.settings.SecureSettings;

import kotlin.Unit;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -96,8 +98,6 @@ import java.util.concurrent.Executor;

import javax.inject.Inject;

import kotlin.Unit;

/**
 * Contains the collapsed status bar and handles hiding/showing based on disable flags
 * and keyguard state. Also manages lifecycle to make sure the views it contains are being
@@ -606,7 +606,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue

        // Hide notifications if the disable flag is set or we have an ongoing call.
        if (disableNotifications || hasOngoingCall) {
            hideNotificationIconArea(animate);
            hideNotificationIconArea(animate && !hasOngoingCall);
        } else {
            showNotificationIconArea(animate);
        }
+14 −0
Original line number Diff line number Diff line
@@ -499,6 +499,20 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
                mFragment.getView().findViewById(R.id.ongoing_call_chip).getVisibility());
    }

    @Test
    public void disable_hasOngoingCall_hidesNotifsWithoutAnimation() {
        CollapsedStatusBarFragment fragment = resumeAndGetFragment();
        fragment.disable(DEFAULT_DISPLAY, 0, 0, false);

        // Ongoing call started
        when(mOngoingCallController.hasOngoingCall()).thenReturn(true);
        fragment.disable(DEFAULT_DISPLAY, 0, 0, true);

        // Notification area is hidden without delay
        assertEquals(0f, mNotificationAreaInner.getAlpha(), 0.01);
        assertEquals(View.INVISIBLE, mNotificationAreaInner.getVisibility());
    }

    @Test
    public void disable_isDozing_clockAndSystemInfoVisible() {
        CollapsedStatusBarFragment fragment = resumeAndGetFragment();