private boolean NeedReconnect() {
    ConnectivityManager cm =
        (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo ni_active = cm.getActiveNetworkInfo();

    return ni_active != null
        && ni_active.getTypeName().equalsIgnoreCase("mobile")
        && ni_active.isConnected()
        && cm.getMobileDataEnabled();
  }
  @Override
  public void setPreferredNetworkType(int networkType, Message response) {
    /* Samsung modem implementation does bad things when a datacall is running
     * while switching the preferred networktype.
     */
    ConnectivityManager cm =
        (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);

    if (cm.getMobileDataEnabled()) {
      ConnectivityHandler handler = new ConnectivityHandler(mContext);
      handler.setPreferedNetworkType(networkType, response);
    } else {
      sendPreferedNetworktype(networkType, response);
    }
  }
 private boolean isMobileDataEnabled() {
   ConnectivityManager cm =
       (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
   return cm.getMobileDataEnabled();
 }
 private boolean test03DataConnectPrecondition() {
   ConnectivityManager connService = ConnectivityManager.from(this);
   return !connService.getMobileDataEnabled();
 }