Merge "[Ongoing Call] Don't show the ongoing call chip when there's a HUN." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e186eb937b
@@ -453,9 +453,6 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
protected int adjustDisableFlags(int state) {
|
protected int adjustDisableFlags(int state) {
|
||||||
boolean headsUpVisible =
|
boolean headsUpVisible =
|
||||||
mStatusBarFragmentComponent.getHeadsUpAppearanceController().shouldBeVisible();
|
mStatusBarFragmentComponent.getHeadsUpAppearanceController().shouldBeVisible();
|
||||||
if (headsUpVisible) {
|
|
||||||
state |= DISABLE_CLOCK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mKeyguardStateController.isLaunchTransitionFadingAway()
|
if (!mKeyguardStateController.isLaunchTransitionFadingAway()
|
||||||
&& !mKeyguardStateController.isKeyguardFadingAway()
|
&& !mKeyguardStateController.isKeyguardFadingAway()
|
||||||
@@ -473,6 +470,13 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
state |= DISABLE_ONGOING_CALL_CHIP;
|
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;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -332,6 +332,19 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
mFragment.getView().findViewById(R.id.ongoing_call_chip).getVisibility());
|
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
|
@Test
|
||||||
public void disable_ongoingCallEnded_chipHidden() {
|
public void disable_ongoingCallEnded_chipHidden() {
|
||||||
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
|
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
|
||||||
|
|||||||
Reference in New Issue
Block a user