Merge "[Ongoing Call] Don't show the ongoing call chip when there's a HUN." into tm-qpr-dev am: e186eb937b

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

Change-Id: I6c69f5905cc56a2723fc5207f8cfb28291595d56
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Caitlin Shkuratov
2023-03-20 17:44:31 +00:00
committed by Automerger Merge Worker
2 changed files with 20 additions and 3 deletions

View File

@@ -453,9 +453,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
protected int adjustDisableFlags(int state) {
boolean headsUpVisible =
mStatusBarFragmentComponent.getHeadsUpAppearanceController().shouldBeVisible();
if (headsUpVisible) {
state |= DISABLE_CLOCK;
}
if (!mKeyguardStateController.isLaunchTransitionFadingAway()
&& !mKeyguardStateController.isKeyguardFadingAway()
@@ -473,6 +470,13 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
state |= DISABLE_ONGOING_CALL_CHIP;
}
if (headsUpVisible) {
// Disable everything on the left side of the status bar, since the app name for the
// heads up notification appears there instead.
state |= DISABLE_CLOCK;
state |= DISABLE_ONGOING_CALL_CHIP;
}
return state;
}

View File

@@ -332,6 +332,19 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
mFragment.getView().findViewById(R.id.ongoing_call_chip).getVisibility());
}
@Test
public void disable_hasOngoingCallButAlsoHun_chipHidden() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
when(mOngoingCallController.hasOngoingCall()).thenReturn(true);
when(mHeadsUpAppearanceController.shouldBeVisible()).thenReturn(true);
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
assertEquals(View.GONE,
mFragment.getView().findViewById(R.id.ongoing_call_chip).getVisibility());
}
@Test
public void disable_ongoingCallEnded_chipHidden() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();