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

Commit f8209383 authored by Holly Jiuyu Sun's avatar Holly Jiuyu Sun
Browse files

Store the message object for later use.

When the message object is used in background thread, the original
object may be changed. We need to store the message object in a local
variable to use it later.

Bug: 134087340
Test: test on phone
Change-Id: Ib160ed5276fff0e1ad4fb620a7b69eb1e44251f2
parent 13ff2eb1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -322,12 +322,13 @@ public class SubscriptionInfoUpdater extends Handler {

            case EVENT_REFRESH_EMBEDDED_SUBSCRIPTIONS:
                cardIds.add(msg.arg1);
                Runnable r = (Runnable) msg.obj;
                updateEmbeddedSubscriptions(cardIds, (hasChanges) -> {
                    if (hasChanges) {
                        SubscriptionController.getInstance().notifySubscriptionInfoChanged();
                    }
                    if (msg.obj != null) {
                        ((Runnable) msg.obj).run();
                    if (r != null) {
                        r.run();
                    }
                });
                break;