Loading telephony/java/com/android/internal/telephony/DataConnectionTracker.java +3 −24 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; Loading telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -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, Loading telephony/java/com/android/internal/telephony/Phone.java +6 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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. */ Loading telephony/java/com/android/internal/telephony/PhoneBase.java +7 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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 * Loading telephony/java/com/android/internal/telephony/PhoneProxy.java +6 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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 Loading
telephony/java/com/android/internal/telephony/DataConnectionTracker.java +3 −24 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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) { Loading Loading @@ -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; Loading
telephony/java/com/android/internal/telephony/DefaultPhoneNotifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -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, Loading
telephony/java/com/android/internal/telephony/Phone.java +6 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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. */ Loading
telephony/java/com/android/internal/telephony/PhoneBase.java +7 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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 * Loading
telephony/java/com/android/internal/telephony/PhoneProxy.java +6 −2 Original line number Diff line number Diff line Loading @@ -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) { Loading Loading @@ -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