Solve NPE.
`secondaryLabel` is public and may be changed from other threads, therefore make a local reference and use the local reference. Bug: 271270746 Test: build SystemUI and verify the secondary label works properly Change-Id: I71c79bcf380ce46ad5f0be6b8e2a7647df55f5bf
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user