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

Commit 2530f95b authored by Jayachandran Chinnakkannu's avatar Jayachandran Chinnakkannu Committed by Android (Google) Code Review
Browse files

Merge "Skip sending RIL_REQUEST_ALLOW_DATA on single SIM devices" into oc-dr1-dev

parents d617ef1e c3a015d2
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -336,7 +336,10 @@ public class PhoneSwitcher extends Handler {
        state.active = false;
        log("deactivate " + phoneId);
        state.lastRequested = System.currentTimeMillis();
        // Skip ALLOW_DATA for single SIM device
        if (mNumPhones > 1) {
            mCommandsInterfaces[phoneId].setDataAllowed(false, null);
        }
        mActivePhoneRegistrants[phoneId].notifyRegistrants();
    }

@@ -346,7 +349,10 @@ public class PhoneSwitcher extends Handler {
        state.active = true;
        log("activate " + phoneId);
        state.lastRequested = System.currentTimeMillis();
        // Skip ALLOW_DATA for single SIM device
        if (mNumPhones > 1) {
            mCommandsInterfaces[phoneId].setDataAllowed(true, null);
        }
        mActivePhoneRegistrants[phoneId].notifyRegistrants();
    }

@@ -361,8 +367,11 @@ public class PhoneSwitcher extends Handler {

    private void onResendDataAllowed(Message msg) {
        final int phoneId = msg.arg1;
        // Skip ALLOW_DATA for single SIM device
        if (mNumPhones > 1) {
            mCommandsInterfaces[phoneId].setDataAllowed(mPhoneStates[phoneId].active, null);
        }
    }

    private int phoneIdForRequest(NetworkRequest netRequest) {
        NetworkSpecifier specifier = netRequest.networkCapabilities.getNetworkSpecifier();