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

Commit 83adbff6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Hide the mobile slot when QSBH expands in legacy model" into sc-dev am: 6e776921

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

Change-Id: Icfc291f77e758e335ba5215e69e9dd94940454b7
parents 27176b21 6e776921
Loading
Loading
Loading
Loading
+30 −7
Original line number Diff line number Diff line
@@ -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);
                        // 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);
                        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);
                        if (mProviderModel) {
                            mIconContainer.removeIgnoredSlot(mNoCallingSlotName);
                            mIconContainer.removeIgnoredSlot(mCallStrengthSlotName);
                        } else {
                            mIconContainer.removeIgnoredSlot(mMobileSlotName);
                        }

                        setSeparatorVisibility(mShowClockIconsSeparator);
                    }