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

Commit 79f9daf3 authored by Junda Liu's avatar Junda Liu
Browse files

Add hasMatchedTetherApnSetting support.

Code will check TETHER_DUN_APN setting and config_tether_apndata for APN that
matches current operator.

Bug: b/18158411
Change-Id: I0780bce96cfce8752e9bb0c10b9d156ef5a54f06
parent b502a189
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -276,6 +276,13 @@ public interface Phone {
     */
    String[] getActiveApnTypes();

    /**
     * Check if TETHER_DUN_APN setting or config_tether_apndata includes APN that matches
     * current operator.
     * @return true if there is a matching DUN APN.
     */
    boolean hasMatchedTetherApnSetting();

    /**
     * Returns string for the active APN host.
     *  @return type as a string or null if none.
+5 −0
Original line number Diff line number Diff line
@@ -1677,6 +1677,11 @@ public abstract class PhoneBase extends Handler implements Phone {
        return mDcTracker.getActiveApnTypes();
    }

    @Override
    public boolean hasMatchedTetherApnSetting() {
        return mDcTracker.hasMatchedTetherApnSetting();
    }

    @Override
    public String getActiveApnHost(String apnType) {
        return mDcTracker.getActiveApnString(apnType);
+5 −0
Original line number Diff line number Diff line
@@ -413,6 +413,11 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.getActiveApnTypes();
    }

    @Override
    public boolean hasMatchedTetherApnSetting() {
        return mActivePhone.hasMatchedTetherApnSetting();
    }

    @Override
    public String getActiveApnHost(String apnType) {
        return mActivePhone.getActiveApnHost(apnType);
+6 −0
Original line number Diff line number Diff line
@@ -716,6 +716,12 @@ public abstract class DcTrackerBase extends Handler {
        return retDunSetting;
    }

    public boolean hasMatchedTetherApnSetting() {
        ApnSetting matched = fetchDunApn();
        log("hasMatchedTetherApnSetting: APN=" + matched);
        return matched != null;
    }

    public String[] getActiveApnTypes() {
        String[] result;
        if (mActiveApn != null) {