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

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

Merge "Clean up memory leak in volume dialog"

parents 6ce3af05 20ad4dab
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ public class ConfigurableTexts {

    public int add(final TextView text, final int labelResId) {
        if (text == null) return 0;
        if (mTexts.containsKey(text)) {
            return mTexts.get(text);
        }
        final Resources res = mContext.getResources();
        final float fontScale = res.getConfiguration().fontScale;
        final float density = res.getDisplayMetrics().density;
@@ -63,6 +66,11 @@ public class ConfigurableTexts {
        return sp;
    }

    public void remove(final TextView text) {
        mTexts.remove(text);
        mTextLabels.remove(text);
    }

    public void update() {
        if (mTexts.isEmpty()) return;
        mTexts.keyAt(0).post(mUpdateAll);
+1 −0
Original line number Diff line number Diff line
@@ -922,6 +922,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            if (!mDynamic.get(row.stream)) {
                mRows.remove(i);
                mDialogRowsView.removeView(row.view);
                mConfigurableTexts.remove(row.header);
            }
        }
    }