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

Commit 517cab6c authored by Ramesh Sudini's avatar Ramesh Sudini Committed by Android Git Automerger
Browse files

am dff90b7d: am a5c9c724: Data Availability Indication changes.

* commit 'dff90b7d':
  Data Availability Indication changes.
parents 644c4f18 dff90b7d
Loading
Loading
Loading
Loading
+3 −24
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ public abstract class DataConnectionTracker extends Handler {
    }

    /** TODO: See if we can remove */
    public String getActiveApnString() {
    public String getActiveApnString(String apnType) {
        String result = null;
        if (mActiveApn != null) {
            result = mActiveApn.apn;
@@ -466,6 +466,8 @@ public abstract class DataConnectionTracker extends Handler {
    protected abstract void onVoiceCallEnded();
    protected abstract void onCleanUpConnection(boolean tearDown, int apnId, String reason);
    protected abstract void onCleanUpAllConnections(String cause);
    protected abstract boolean isDataPossible();
    protected abstract boolean isDataPossible(String apnType);

    @Override
    public void handleMessage(Message msg) {
@@ -719,29 +721,6 @@ public abstract class DataConnectionTracker extends Handler {
        notifyOffApnsOfAvailability(reason, isDataPossible());
    }

    /**
     * The only circumstances under which we report that data connectivity is not
     * possible are
     * <ul>
     * <li>Data is disallowed (roaming, power state, voice call, etc).</li>
     * <li>The current data state is {@code DISCONNECTED} for a reason other than
     * having explicitly disabled connectivity. In other words, data is not available
     * because the phone is out of coverage or some like reason.</li>
     * </ul>
     * @return {@code true} if data connectivity is possible, {@code false} otherwise.
     */
    protected boolean isDataPossible() {
        boolean dataAllowed = isDataAllowed();
        boolean anyDataEnabled = getAnyDataEnabled();
        boolean possible = (dataAllowed
                && !(anyDataEnabled && (mState == State.FAILED || mState == State.IDLE)));
        if (!possible && DBG) {
            log("isDataPossible() " + possible + ", dataAllowed=" + dataAllowed +
                    " anyDataEnabled=" + anyDataEnabled + " dataState=" + mState);
        }
        return possible;
    }

    public boolean isApnTypeEnabled(String apnType) {
        if (apnType == null) {
            return false;
+2 −2
Original line number Diff line number Diff line
@@ -114,8 +114,8 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
        try {
            mRegistry.notifyDataConnection(
                    convertDataState(state),
                    sender.isDataConnectivityPossible(), reason,
                    sender.getActiveApnHost(),
                    sender.isDataConnectivityPossible(apnType), reason,
                    sender.getActiveApnHost(apnType),
                    apnType,
                    linkProperties,
                    linkCapabilities,
+6 −1
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ public interface Phone {
     * Returns string for the active APN host.
     *  @return type as a string or null if none.
     */
    String getActiveApnHost();
    String getActiveApnHost(String apnType);

    /**
     * Return the LinkProperties for the named apn or null if not available
@@ -1374,6 +1374,11 @@ public interface Phone {
     */
    boolean isDataConnectivityPossible();

    /**
     * Report on whether data connectivity is allowed for an APN.
     */
    boolean isDataConnectivityPossible(String apnType);

    /**
     * Retrieves the unique device ID, e.g., IMEI for GSM phones and MEID for CDMA phones.
     */
+7 −2
Original line number Diff line number Diff line
@@ -977,8 +977,8 @@ public abstract class PhoneBase extends Handler implements Phone {
        return mDataConnectionTracker.getActiveApnTypes();
    }

    public String getActiveApnHost() {
        return mDataConnectionTracker.getActiveApnString();
    public String getActiveApnHost(String apnType) {
        return mDataConnectionTracker.getActiveApnString(apnType);
    }

    public LinkProperties getLinkProperties(String apnType) {
@@ -1001,6 +1001,11 @@ public abstract class PhoneBase extends Handler implements Phone {
        return ((mDataConnectionTracker != null) && (mDataConnectionTracker.isDataPossible()));
    }

    public boolean isDataConnectivityPossible(String apnType) {
        return ((mDataConnectionTracker != null) &&
                (mDataConnectionTracker.isDataPossible(apnType)));
    }

    /**
     * simulateDataConnection
     *
+6 −2
Original line number Diff line number Diff line
@@ -208,8 +208,8 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.getActiveApnTypes();
    }

    public String getActiveApnHost() {
        return mActivePhone.getActiveApnHost();
    public String getActiveApnHost(String apnType) {
        return mActivePhone.getActiveApnHost(apnType);
    }

    public LinkProperties getLinkProperties(String apnType) {
@@ -661,6 +661,10 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.isDataConnectivityPossible();
    }

    public boolean isDataConnectivityPossible(String apnType) {
        return mActivePhone.isDataConnectivityPossible(apnType);
    }

    public String getDeviceId() {
        return mActivePhone.getDeviceId();
    }
Loading