diff options
| -rw-r--r-- | packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java index 1d28c63f8398..c0b69c169ccd 100644 --- a/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java +++ b/packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java @@ -189,10 +189,12 @@ public interface QSTile { /** Get the text for secondaryLabel. */ public String getSecondaryLabel(String stateText) { - if (TextUtils.isEmpty(secondaryLabel)) { + // Use a local reference as the value might change from other threads + CharSequence localSecondaryLabel = secondaryLabel; + if (TextUtils.isEmpty(localSecondaryLabel)) { return stateText; } - return secondaryLabel.toString(); + return localSecondaryLabel.toString(); } public boolean copyTo(State other) { |