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

Commit 27700ef1 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 8525

* changes:
  Add method in Phone interface to check whether data is enabled.
parents d0ac7ab1 c6d6b687
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1265,6 +1265,13 @@ public interface Phone {
     */
    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,
     * i.e., not the default APN.
+4 −0
Original line number Diff line number Diff line
@@ -614,6 +614,10 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.disableApnType(type);
    }

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

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

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

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

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

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