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

Commit 4375b00d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Dont reuse DcController object after calling dispose() on it." into...

Merge "Dont reuse DcController object after calling dispose() on it." into rvc-dev am: 273f974d am: 674116f6

Change-Id: I580d8a7227089c09de62d0e7ef3663765a48986f
parents 1d0a2489 674116f6
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ public class DcTracker extends Handler {
            "extra_handover_failure_fallback";

    private final String mLogTag;
    private final String mLogTagSuffix;

    public AtomicBoolean isCleanupRequired = new AtomicBoolean(false);

@@ -672,13 +673,12 @@ public class DcTracker extends Handler {
                .createForSubscriptionId(phone.getSubId());
        // The 'C' in tag indicates cellular, and 'I' indicates IWLAN. This is to distinguish
        // between two DcTrackers, one for each.
        String tagSuffix = "-" + ((transportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                ? "C" : "I");
        tagSuffix += "-" + mPhone.getPhoneId();
        mLogTag = "DCT" + tagSuffix;
        mLogTagSuffix = "-" + ((transportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN)
                ? "C" : "I") + "-" + mPhone.getPhoneId();
        mLogTag = "DCT" + mLogTagSuffix;

        mTransportType = transportType;
        mDataServiceManager = new DataServiceManager(phone, transportType, tagSuffix);
        mDataServiceManager = new DataServiceManager(phone, transportType, mLogTagSuffix);

        mResolver = mPhone.getContext().getContentResolver();
        mAlarmManager =
@@ -714,7 +714,7 @@ public class DcTracker extends Handler {
        mHandlerThread = new HandlerThread("DcHandlerThread");
        mHandlerThread.start();
        Handler dcHandler = new Handler(mHandlerThread.getLooper());
        mDcc = DcController.makeDcc(mPhone, this, mDataServiceManager, dcHandler, tagSuffix);
        mDcc = DcController.makeDcc(mPhone, this, mDataServiceManager, dcHandler, mLogTagSuffix);
        mDcTesterFailBringUpAll = new DcTesterFailBringUpAll(mPhone, dcHandler);

        mDataConnectionTracker = this;
@@ -737,6 +737,7 @@ public class DcTracker extends Handler {
    @VisibleForTesting
    public DcTracker() {
        mLogTag = "DCT";
        mLogTagSuffix = null;
        mTelephonyManager = null;
        mAlarmManager = null;
        mPhone = null;
@@ -5040,9 +5041,16 @@ public class DcTracker extends Handler {

    private void onDataServiceBindingChanged(boolean bound) {
        if (bound) {
            if (mDcc == null) {
                mDcc = DcController.makeDcc(mPhone, this, mDataServiceManager,
                        new Handler(mHandlerThread.getLooper()), mLogTagSuffix);
            }
            mDcc.start();
        } else {
            mDcc.dispose();
            // dispose sets the associated Handler object (StateMachine#mSmHandler) to null, so mDcc
            // needs to be created again (simply calling start() on it after dispose will not work)
            mDcc = null;
        }
        mDataServiceBound = bound;
    }