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

Commit 80b20580 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge "Fix various thread and memory leaks"

parents 6e30ffed c477c9d8
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
@@ -653,6 +653,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
@@ -709,9 +710,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);

@@ -828,6 +829,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
@@ -311,6 +311,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