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

Commit c6d6b687 authored by Wink Saville's avatar Wink Saville
Browse files

Add method in Phone interface to check whether data is enabled.

This adds isDataConnectivityEnabled to allow test methods to query the
data connectivity state.
parent 30b06eb8
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -1265,6 +1265,13 @@ public interface Phone {
     */
     */
    boolean disableDataConnectivity();
    boolean disableDataConnectivity();


    /**
     * Report the current state of data connectivity (enabled or disabled)
     * @return {@code false} if data connectivity has been explicitly disabled,
     * {@code true} otherwise.
     */
    boolean isDataConnectivityEnabled();

    /**
    /**
     * Enables the specified APN type. Only works for "special" APN types,
     * Enables the specified APN type. Only works for "special" APN types,
     * i.e., not the default APN.
     * i.e., not the default APN.
+4 −0
Original line number Original line Diff line number Diff line
@@ -614,6 +614,10 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.disableApnType(type);
        return mActivePhone.disableApnType(type);
    }
    }


    public boolean isDataConnectivityEnabled() {
        return mActivePhone.isDataConnectivityEnabled();
    }

    public boolean isDataConnectivityPossible() {
    public boolean isDataConnectivityPossible() {
        return mActivePhone.isDataConnectivityPossible();
        return mActivePhone.isDataConnectivityPossible();
    }
    }
+4 −0
Original line number Original line Diff line number Diff line
@@ -508,6 +508,10 @@ public class CDMAPhone extends PhoneBase {
        return false;
        return false;
    }
    }


    public boolean isDataConnectivityEnabled() {
        return mDataConnection.getDataEnabled();
    }

    public boolean isDataConnectivityPossible() {
    public boolean isDataConnectivityPossible() {
        boolean noData = mDataConnection.getDataEnabled() &&
        boolean noData = mDataConnection.getDataEnabled() &&
                getDataConnectionState() == DataState.DISCONNECTED;
                getDataConnectionState() == DataState.DISCONNECTED;
+4 −0
Original line number Original line Diff line number Diff line
@@ -1169,6 +1169,10 @@ public class GSMPhone extends PhoneBase {
        return mDataConnection.getDnsServers(apnType);
        return mDataConnection.getDnsServers(apnType);
    }
    }


    public boolean isDataConnectivityEnabled() {
        return mDataConnection.getDataEnabled();
    }

    /**
    /**
     * The only circumstances under which we report that data connectivity is not
     * The only circumstances under which we report that data connectivity is not
     * possible are
     * possible are