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

Commit 57dd1c1f authored by Robert Snoeberger's avatar Robert Snoeberger
Browse files

Reduce native heap usage of QSCarrier#updateState.

Avoid unnecessary calls to ImageView#setImageDrawable with a new Signal
Drawable.

Fixes: 144098259
Test: While running native heap profiler, change the mobile network
level in demo mode. Then, look at space used by QSCarrier#updateState.

Change-Id: Id640cbedb452bdc9e7fd4da4b28c316fd1353c28
parent 052a8395
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ public class QSCarrier extends LinearLayout {
        mMobileRoaming = findViewById(R.id.mobile_roaming);
        mCarrierText = findViewById(R.id.qs_carrier_text);

        mMobileSignal.setImageDrawable(new SignalDrawable(mContext));

        int colorForeground = Utils.getColorAttrDefaultColor(mContext,
                android.R.attr.colorForeground);
        mColorForegroundStateList = ColorStateList.valueOf(colorForeground);
@@ -78,7 +80,6 @@ public class QSCarrier extends LinearLayout {
            ColorStateList colorStateList = ColorStateList.valueOf(
                    mDualToneHandler.getSingleColor(mColorForegroundIntensity));
            mMobileRoaming.setImageTintList(colorStateList);
            mMobileSignal.setImageDrawable(new SignalDrawable(mContext));
            mMobileSignal.setImageTintList(colorStateList);
            mMobileSignal.setImageLevel(state.mobileSignalIconId);