summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ConfigurableTexts.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java1
2 files changed, 9 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ConfigurableTexts.java b/packages/SystemUI/src/com/android/systemui/volume/ConfigurableTexts.java
index 20de5bb33462..f1b9590bce73 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ConfigurableTexts.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ConfigurableTexts.java
@@ -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);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index edf7b6cc2539..f5c158734fcc 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -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);
}
}
}