diff options
| author | Wink Saville <wink@google.com> | 2013-06-29 21:10:57 -0700 |
|---|---|---|
| committer | Wink Saville <wink@google.com> | 2013-06-29 21:10:57 -0700 |
| commit | ab9321d13de29cf314e8a1774b592d1f1d7e94d8 (patch) | |
| tree | 3ddf662a65410572a2d0634252212a383e7f840f /core/java/android/net/ConnectivityManager.java | |
| parent | 99e4a0f576bad57782b31f1b3329a3d2408f42ae (diff) | |
Add checkMobileProvisioning to ConnectivityService.
Bug: 9279964
Change-Id: I42c326a21e05aa301e9d974ed9ac1d59472780ec
Diffstat (limited to 'core/java/android/net/ConnectivityManager.java')
| -rw-r--r-- | core/java/android/net/ConnectivityManager.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 78bf9afcbb40..6487c9267e9e 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -25,6 +25,7 @@ import android.os.Binder; import android.os.Build.VERSION_CODES; import android.os.Messenger; import android.os.RemoteException; +import android.os.ResultReceiver; import android.provider.Settings; import java.net.InetAddress; @@ -1294,4 +1295,67 @@ public class ConnectivityManager { } catch (RemoteException e) { } } + + /** + * The ResultReceiver resultCode for checkMobileProvisioning (CMP_RESULT_CODE) + */ + + /** + * No connection was possible to the network. + * {@hide} + */ + public static final int CMP_RESULT_CODE_NO_CONNECTION = 0; + + /** + * A connection was made to the internet, all is well. + * {@hide} + */ + public static final int CMP_RESULT_CODE_CONNECTABLE = 1; + + /** + * A connection was made but there was a redirection, we appear to be in walled garden. + * This is an indication of a warm sim on a mobile network. + * {@hide} + */ + public static final int CMP_RESULT_CODE_REDIRECTED = 2; + + /** + * A connection was made but no dns server was available to resolve a name to address. + * This is an indication of a warm sim on a mobile network. + * + * {@hide} + */ + public static final int CMP_RESULT_CODE_NO_DNS = 3; + + /** + * A connection was made but could not open a TCP connection. + * This is an indication of a warm sim on a mobile network. + * {@hide} + */ + public static final int CMP_RESULT_CODE_NO_TCP_CONNECTION = 4; + + /** + * Check mobile provisioning. The resultCode passed to + * onReceiveResult will be one of the CMP_RESULT_CODE_xxxx values above. + * This may take a minute or more to complete. + * + * @param sendNotificaiton, when true a notification will be sent to user. + * @param suggestedTimeOutMs, timeout in milliseconds + * @param resultReceiver needs to be supplied to receive the result + * + * @return time out that will be used, maybe less that suggestedTimeOutMs + * -1 if an error. + * + * {@hide} + */ + public int checkMobileProvisioning(boolean sendNotification, int suggestedTimeOutMs, + ResultReceiver resultReceiver) { + int timeOutMs = -1; + try { + timeOutMs = mService.checkMobileProvisioning(sendNotification, suggestedTimeOutMs, + resultReceiver); + } catch (RemoteException e) { + } + return timeOutMs; + } } |
