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

Commit 4c76f8db authored by Holly Sun's avatar Holly Sun
Browse files

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
parent 2b9ee44d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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) {