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

Commit b1a3a5f5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Always copy SignalIconState when keeping a reference" into pi-dev

parents 16c671dc 56fb9f8a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -100,13 +100,13 @@ public class StatusBarMobileView extends AlphaOptimizedLinearLayout implements D
        }

        if (mState == null) {
            mState = state;
            mState = state.copy();
            initViewState();
            return;
        }

        if (!mState.equals(state)) {
            updateState(state);
            updateState(state.copy());
        }
    }

+9 −8
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public class StatusBarWifiView extends FrameLayout implements DarkReceiver,
    private WifiIconState mState;
    private String mSlot;
    private float mDarkIntensity = 0;
    private int mVisibleState = -1;

    private ContextThemeWrapper mDarkContext;
    private ContextThemeWrapper mLightContext;
@@ -73,6 +74,7 @@ public class StatusBarWifiView extends FrameLayout implements DarkReceiver,
        StatusBarWifiView v = (StatusBarWifiView) inflater.inflate(R.layout.status_bar_wifi_group, null);
        v.setSlot(slot);
        v.init();
        v.setVisibleState(STATE_ICON);
        return v;
    }

@@ -123,6 +125,11 @@ public class StatusBarWifiView extends FrameLayout implements DarkReceiver,

    @Override
    public void setVisibleState(int state) {
        if (state == mVisibleState) {
            return;
        }
        mVisibleState = state;

        switch (state) {
            case STATE_ICON:
                mWifiGroup.setVisibility(View.VISIBLE);
@@ -139,12 +146,6 @@ public class StatusBarWifiView extends FrameLayout implements DarkReceiver,
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        int width = MeasureSpec.getSize(widthMeasureSpec);
    }

    private void init() {
        int dualToneLightTheme = Utils.getThemeAttr(mContext, R.attr.lightIconTheme);
        int dualToneDarkTheme = Utils.getThemeAttr(mContext, R.attr.darkIconTheme);
@@ -180,12 +181,12 @@ public class StatusBarWifiView extends FrameLayout implements DarkReceiver,
        }

        if (mState == null) {
            mState = state;
            mState = state.copy();
            initViewState();
        }

        if (!mState.equals(state)) {
            updateState(state);
            updateState(state.copy());
        }
    }

+4 −0
Original line number Diff line number Diff line
@@ -110,6 +110,10 @@ public class StatusBarIconHolder {
    }

    public void setVisible(boolean visible) {
        if (isVisible() == visible) {
            return;
        }

        switch (mType) {
            case TYPE_ICON:
                mIcon.visible = visible;
+6 −0
Original line number Diff line number Diff line
@@ -388,6 +388,12 @@ public class StatusBarSignalPolicy implements NetworkControllerImpl.SignalCallba
                            typeContentDescription);
        }

        public MobileIconState copy() {
            MobileIconState copy = new MobileIconState(this.subId);
            copyTo(copy);
            return copy;
        }

        public void copyTo(MobileIconState other) {
            super.copyTo(other);
            other.subId = subId;