summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-05-12 19:46:34 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-05-12 19:46:34 +0000
commit6e77692106df1cd8bc8d621c76d78426d2fd38db (patch)
tree98c62e920d6904b65db6dc1648a9754e04b00db2
parent444187faad3a4c5c4e6760c4d30267a0d44df766 (diff)
parent05b2ad48fb223593633ad6b441b7e7189f8e5268 (diff)
Merge "Hide the mobile slot when QSBH expands in legacy model" into sc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java37
1 files changed, 30 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index 26332f41f675..81b5318d8089 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -23,6 +23,7 @@ import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Rect;
import android.util.AttributeSet;
+import android.util.FeatureFlagUtils;
import android.util.Pair;
import android.view.DisplayCutout;
import android.view.View;
@@ -87,13 +88,21 @@ public class QuickStatusBarHeader extends FrameLayout {
private int mTopViewMeasureHeight;
private final String mMobileSlotName;
+ private final String mNoCallingSlotName;
private final String mCallStrengthSlotName;
+ private final boolean mProviderModel;
public QuickStatusBarHeader(Context context, AttributeSet attrs) {
super(context, attrs);
- mMobileSlotName = context.getString(com.android.internal.R.string.status_bar_no_calling);
+ mMobileSlotName = context.getString(com.android.internal.R.string.status_bar_mobile);
+ mNoCallingSlotName = context.getString(com.android.internal.R.string.status_bar_no_calling);
mCallStrengthSlotName =
context.getString(com.android.internal.R.string.status_bar_call_strength);
+ if (FeatureFlagUtils.isEnabled(context, FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) {
+ mProviderModel = true;
+ } else {
+ mProviderModel = false;
+ }
}
/**
@@ -242,14 +251,24 @@ public class QuickStatusBarHeader extends FrameLayout {
.setListener(new TouchAnimator.ListenerAdapter() {
@Override
public void onAnimationAtEnd() {
- mIconContainer.addIgnoredSlot(mMobileSlotName);
- mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
+ // TODO(b/185580157): Remove the mProviderModel if the mobile slot can be
+ // hidden in Provider model.
+ if (mProviderModel) {
+ mIconContainer.addIgnoredSlot(mNoCallingSlotName);
+ mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
+ } else {
+ mIconContainer.addIgnoredSlot(mMobileSlotName);
+ }
}
@Override
public void onAnimationStarted() {
- mIconContainer.addIgnoredSlot(mMobileSlotName);
- mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
+ if (mProviderModel) {
+ mIconContainer.addIgnoredSlot(mNoCallingSlotName);
+ mIconContainer.addIgnoredSlot(mCallStrengthSlotName);
+ } else {
+ mIconContainer.addIgnoredSlot(mMobileSlotName);
+ }
setSeparatorVisibility(false);
}
@@ -257,8 +276,12 @@ public class QuickStatusBarHeader extends FrameLayout {
@Override
public void onAnimationAtStart() {
super.onAnimationAtStart();
- mIconContainer.removeIgnoredSlot(mMobileSlotName);
- mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
+ if (mProviderModel) {
+ mIconContainer.removeIgnoredSlot(mNoCallingSlotName);
+ mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
+ } else {
+ mIconContainer.removeIgnoredSlot(mMobileSlotName);
+ }
setSeparatorVisibility(mShowClockIconsSeparator);
}