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

Commit 55899976 authored by tomhsu's avatar tomhsu
Browse files

Fix concurrent issue

 - Add a thread lock

Fix: 286495550
Test: make pass
Change-Id: I72877551bda18cf93734d270770a0bd53bab465b
parent cc10abe1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -295,7 +295,9 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
    }

    public void removeRegister(MobileNetworkCallback mobileNetworkCallback) {
        synchronized (this) {
            sCallbacks.remove(mobileNetworkCallback);
        }
        if (sCallbacks.isEmpty()) {
            mSubscriptionManager.removeOnSubscriptionsChangedListener(this);
            mAirplaneModeObserver.unRegister(mContext);