public int startDmDataConnectivity() throws IOException { Assert.assertFalse( "startDmDataConnectivity MUST NOT be called in direct internet conn.", Options.UseDirectInternet); // if gemini is set int result = -1; simId = DmCommomFun.getSimRegisterID(mContext); if (simId == -1) { Log.e(TAG.Connection, "Get Register SIM ID error in start data connection"); return result; } // for gemini if (MTKOptions.MTK_GEMINI_SUPPORT == true) { // begin for connectity gemini if (mDmDatabase.DmApnReady(simId) == false) { Log.e(TAG.Connection, "Dm apn table is not ready!"); return result; } result = beginDmDataConnectivityGemini(simId); } else { if (mDmDatabase.DmApnReady(GEMINI_SIM_1) == false) { Log.e(TAG.Connection, "Dm apn table is not ready!"); return result; } result = beginDmDataConnectivity(); } if (result == MTKPhone.APN_TYPE_NOT_AVAILABLE || result == MTKPhone.APN_REQUEST_FAILED) { Log.e(TAG.Connection, "start Dmdate Connectivity error"); } // for test begin if (result == MTKPhone.APN_ALREADY_ACTIVE) { Log.i( TAG.Connection, "DataConnection is already exist and send MSG_WAP_CONNECTION_SUCCESS to client"); notifyHandlers(IDmPersistentValues.MSG_WAP_CONNECTION_SUCCESS); } // for test end return result; }
private void ensureRouteToHost() throws IOException { Log.v(TAG.Connection, "Begin ensureRouteToHost"); // call getApnInfoFromSettings String proxyAddr = mDmDatabase.getApnProxyFromSettings(); int inetAddr = lookupHost(proxyAddr); Log.i(TAG.Connection, "inetAddr = " + inetAddr); // get the addr form setting if (!mConnMgr.requestRouteToHost(MTKConnectivity.TYPE_MOBILE_DM, inetAddr)) { throw new IOException("Cannot establish route to proxy " + inetAddr); } }