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

Commit 66b7bccc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Correct handling of modem capability query failure."

parents 1fcb30b0 76ab2ed1
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ public class ModemStackController extends Handler {
    private static final int SUCCESS = 1;
    private static final int FAILURE = 0;
    private static final int PRIMARY_STACK_ID = 0;
    private static final int DEFAULT_MAX_DATA_ALLOWED = 1;

    //***** Class Variables
    private static ModemStackController sModemStackController;
@@ -624,14 +625,20 @@ public class ModemStackController extends Handler {

    public int getMaxDataAllowed() {
        logd("getMaxDataAllowed");
        List<Integer> unsortedList = new ArrayList<Integer>(mNumPhones);
        int ret = DEFAULT_MAX_DATA_ALLOWED;
        List<Integer> unsortedList = new ArrayList<Integer>();

        for (int i = 0; i < mNumPhones; i++) {
            if (mModemCapInfo[i] != null) {
                unsortedList.add(mModemCapInfo[i].getMaxDataCap());
            }
        }
        Collections.sort(unsortedList);

        return unsortedList.get(mNumPhones-1);
        int listSize = unsortedList.size();
        if (listSize > 0) {
            ret = unsortedList.get(listSize - 1);
        }
        return ret;
    }

    public int getCurrentStackIdForPhoneId(int phoneId) {