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

Commit 5f65ded5 authored by Alec Mouri's avatar Alec Mouri Committed by Dave Mankoff
Browse files

Revert "Remove Dependency.get from KeyguardSliceTextView."

Revert submission 13536242-b179775696-depenency-get-keyguard

Reason for revert: Candidate reversion for broken tests: b/180440298
Reverted Changes:
I6d0271692:Add ViewController to CarrierText.
I4d9a4a21f:Add Controller for Emergency Button.
I4c76d99f9:Remove Dependency.get from KeyguardSliceTextView.
I730593fcf:Add injection to ClockProvider.
Ifbb93e624:Remove Dependency.get from KeyguardStatusView.
I237215456:Remove final calls to Dependency.get from keyguard...

Change-Id: Ic2fb8e0b25a280ac7d1f76d537a9ecfdc0f9fbab
parent 07b57218
Loading
Loading
Loading
Loading
+18 −17
Original line number Diff line number Diff line
@@ -49,8 +49,10 @@ import androidx.slice.widget.SliceContent;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
import com.android.settingslib.Utils;
import com.android.systemui.Dependency;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.util.wakelock.KeepAwakeAnimationListener;

import java.io.FileDescriptor;
@@ -315,22 +317,6 @@ public class KeyguardSliceView extends LinearLayout {
                R.dimen.widget_label_font_size);
        mRowWithHeaderTextSize = mContext.getResources().getDimensionPixelSize(
                R.dimen.header_row_font_size);

        for (int i = 0; i < mRow.getChildCount(); i++) {
            View child = mRow.getChildAt(i);
            if (child instanceof KeyguardSliceTextView) {
                ((KeyguardSliceTextView) child).onDensityOrFontScaleChanged();
            }
        }
    }

    void onOverlayChanged() {
        for (int i = 0; i < mRow.getChildCount(); i++) {
            View child = mRow.getChildAt(i);
            if (child instanceof KeyguardSliceTextView) {
                ((KeyguardSliceTextView) child).onOverlayChanged();
            }
        }
    }

    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
@@ -493,7 +479,8 @@ public class KeyguardSliceView extends LinearLayout {
     * Representation of an item that appears under the clock on main keyguard message.
     */
    @VisibleForTesting
    static class KeyguardSliceTextView extends TextView {
    static class KeyguardSliceTextView extends TextView implements
            ConfigurationController.ConfigurationListener {
        private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;

        @StyleRes
@@ -505,10 +492,24 @@ public class KeyguardSliceView extends LinearLayout {
            setEllipsize(TruncateAt.END);
        }

        @Override
        protected void onAttachedToWindow() {
            super.onAttachedToWindow();
            Dependency.get(ConfigurationController.class).addCallback(this);
        }

        @Override
        protected void onDetachedFromWindow() {
            super.onDetachedFromWindow();
            Dependency.get(ConfigurationController.class).removeCallback(this);
        }

        @Override
        public void onDensityOrFontScaleChanged() {
            updatePadding();
        }

        @Override
        public void onOverlayChanged() {
            setTextAppearance(sStyleId);
        }
+0 −4
Original line number Diff line number Diff line
@@ -83,10 +83,6 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
        public void onDensityOrFontScaleChanged() {
            mView.onDensityOrFontScaleChanged();
        }
        @Override
        public void onOverlayChanged() {
            mView.onOverlayChanged();
        }
    };

    Observer<Slice> mObserver = new Observer<Slice>() {