Merge "Solve NPE." into tm-qpr-dev am: 9748eedae0

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21752777

Change-Id: I9a31c32b8e07a260fdd709782be785cf763b9578
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Holly Jiuyu Sun
2023-03-13 21:50:22 +00:00
committed by Automerger Merge Worker

View File

@@ -189,10 +189,12 @@ public interface QSTile {
/** Get the text for secondaryLabel. */ /** Get the text for secondaryLabel. */
public String getSecondaryLabel(String stateText) { 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 stateText;
} }
return secondaryLabel.toString(); return localSecondaryLabel.toString();
} }
public boolean copyTo(State other) { public boolean copyTo(State other) {