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

Commit 446a436c authored by Wink Saville's avatar Wink Saville Committed by Android Git Automerger
Browse files

am 4d9261fa: Merge "Use dataConnectionNotInUse to decide if a DC is free." into honeycomb-LTE

* commit '4d9261fa':
  Use dataConnectionNotInUse to decide if a DC is free.
parents 66c37f5d 4d9261fa
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -846,9 +846,16 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
        return result;
    }

    private boolean dataConnectionNotInUse(DataConnectionAc dcac) {
        for (ApnContext apnContext : mApnContexts.values()) {
            if (apnContext.getDataConnectionAc() == dcac) return false;
        }
        return true;
    }

    private GsmDataConnection findFreeDataConnection() {
        for (DataConnectionAc dcac : mDataConnectionAsyncChannels.values()) {
            if (dcac.isInactiveSync()) {
            if (dcac.isInactiveSync() && dataConnectionNotInUse(dcac)) {
                log("findFreeDataConnection: found free GsmDataConnection");
                return (GsmDataConnection) dcac.dataConnection;
            }