Merge change 8525
* changes: Add method in Phone interface to check whether data is enabled.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user