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

Commit 7a4de927 authored by Hall Liu's avatar Hall Liu Committed by Automerger Merge Worker
Browse files

Merge "Fix various thread and memory leaks" into rvc-dev am: 193c2b5a

Change-Id: I2157a230bcc02f8d3d43b7a935ccc8d8436433de
parents ad0f33c0 193c2b5a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -209,8 +209,10 @@ public class RIL extends BaseCommands implements CommandsInterface {
    //***** Instance Variables

    @UnsupportedAppUsage
    final WakeLock mWakeLock;           // Wake lock associated with request/response
    final WakeLock mAckWakeLock;        // Wake lock associated with ack sent
    @VisibleForTesting
    public final WakeLock mWakeLock;           // Wake lock associated with request/response
    @VisibleForTesting
    public final WakeLock mAckWakeLock;        // Wake lock associated with ack sent
    final int mWakeLockTimeout;         // Timeout associated with request/response
    final int mAckWakeLockTimeout;      // Timeout associated with ack sent
    // The number of wakelock requests currently active.  Don't release the lock
+14 −3
Original line number Diff line number Diff line
@@ -655,6 +655,7 @@ public class DcTracker extends Handler {
    private final int mTransportType;

    private DataStallRecoveryHandler mDsRecoveryHandler;
    private HandlerThread mHandlerThread;

    /**
     * Request network completion message map. Key is the APN type, value is the list of completion
@@ -711,9 +712,9 @@ public class DcTracker extends Handler {
                .getSystemService(Context.NETWORK_POLICY_SERVICE);
        mNetworkPolicyManager.registerSubscriptionCallback(mSubscriptionCallback);

        HandlerThread dcHandlerThread = new HandlerThread("DcHandlerThread");
        dcHandlerThread.start();
        Handler dcHandler = new Handler(dcHandlerThread.getLooper());
        mHandlerThread = new HandlerThread("DcHandlerThread");
        mHandlerThread.start();
        Handler dcHandler = new Handler(mHandlerThread.getLooper());
        mDcc = DcController.makeDcc(mPhone, this, mDataServiceManager, dcHandler, tagSuffix);
        mDcTesterFailBringUpAll = new DcTesterFailBringUpAll(mPhone, dcHandler);

@@ -830,6 +831,16 @@ public class DcTracker extends Handler {
        destroyDataConnections();
    }

    /**
     * Stop the internal handler thread
     *
     * TESTING ONLY
     */
    @VisibleForTesting
    public void stopHandlerThread() {
        mHandlerThread.quit();
    }

    private void unregisterForAllEvents() {
         //Unregister for all events
        if (mTransportType == AccessNetworkConstants.TRANSPORT_TYPE_WWAN) {
+3 −0
Original line number Diff line number Diff line
@@ -89,6 +89,9 @@ public class CellularNetworkServiceTest extends TelephonyTest {

    @After
    public void tearDown() throws Exception {
        if (mCellularNetworkService != null) {
            mCellularNetworkService.onDestroy();
        }
        super.tearDown();
    }

+2 −0
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ public class RILTest extends TelephonyTest {

    @After
    public void tearDown() throws Exception {
        mRILUnderTest.mWakeLock.release();
        mRILUnderTest.mAckWakeLock.release();
        super.tearDown();
    }

+3 −0
Original line number Diff line number Diff line
@@ -334,6 +334,9 @@ public class ServiceStateTrackerTest extends TelephonyTest {
        sst = null;
        mSSTTestHandler.quit();
        mSSTTestHandler.join();
        if (mCellularNetworkService != null) {
            mCellularNetworkService.onDestroy();
        }
        super.tearDown();
    }

Loading