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

Commit d5751840 authored by Jack Yu's avatar Jack Yu
Browse files

Fixed the callback not received issue

Telephony callback has weak reference. Need to have
a reference to hold the callback so it won't be
GC'd.

Fix: 343131514
Test: Manual test
Test: atest FrameworksTelephonyTests
Change-Id: I644d6e3a37a699ef539ba9ccc77560d14d60ece3
parent 460a7447
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ public class LinkBandwidthEstimator extends Handler {
    private long mRxBytesDeltaAcc;

    private ModemActivityInfo mLastModemActivityInfo = null;
    private final TelephonyCallback mTelephonyCallback = new TelephonyCallbackImpl();
    private int mSignalStrengthDbm;
    private int mSignalLevel;
    private int mDataRat = TelephonyManager.NETWORK_TYPE_UNKNOWN;
@@ -315,8 +316,7 @@ public class LinkBandwidthEstimator extends Handler {
        if (cm != null) {
            cm.registerDefaultNetworkCallback(mDefaultNetworkCallback, this);
        }
        mTelephonyManager.registerTelephonyCallback(new HandlerExecutor(this),
                new TelephonyCallbackImpl());
        mTelephonyManager.registerTelephonyCallback(new HandlerExecutor(this), mTelephonyCallback);
        mPlaceholderNetwork = new NetworkBandwidth(UNKNOWN_PLMN);
        initAvgBwPerRatTable();
        registerNrStateFrequencyChange();