--- a/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplconnrequestor.cpp Tue Sep 14 22:09:33 2010 +0300
+++ b/supl/locationomasuplprotocolhandler/protocolhandlerver1/src/epos_comasuplconnrequestor.cpp Wed Sep 15 12:40:28 2010 +0300
@@ -50,10 +50,7 @@
iCommMgr(aCommMgr),
iProtocolManager(aProtoMgr),
iPort(aPort),
- iObserver( aObserver),
- iIapDialogShown(EFalse),
- iIapDlgTimerExpired(EFalse),
- iIsTimeoutDialogTimerStarted(EFalse),iPrompt(EFalse),iWlanOnly(EFalse),iIsStaleLocIdPresent(EFalse)
+ iObserver( aObserver),iPrompt(EFalse),iWlanOnly(EFalse),iIsStaleLocIdPresent(EFalse)
{
}
@@ -80,7 +77,6 @@
iCurrentSLPId = KErrNotFound;
- iDialogTimer = COMASuplDialogTimer::NewL(*this);
}
// -----------------------------------------------------------------------------
@@ -110,12 +106,7 @@
COMASuplConnRequestor::~COMASuplConnRequestor()
{
Cancel();
- if(iDialogTimer)
- {
- iDialogTimer->Cancel();
- delete iDialogTimer;
- iDialogTimer = NULL;
- }
+
delete iSuplSettings;
delete iTrace;
delete iFallBackHandler;
@@ -144,48 +135,36 @@
if(errorCode == KErrNone)
{
- TBool ret = ConvertIAPNameToIdL(iapName,iIAPId);
- if(!ret)
- {
- buffer.Copy(_L("No access point configured for "));
- buffer.Append(iHostAddress);
- iTrace->Trace(buffer,KTraceFileName, __LINE__);
- if( isIapDialogShown )
- {
- TInt err = iProtocolManager.LaunchSettingsUI(this,iHostAddress);
- if(err != KErrNone)
- {
- buffer.Copy(_L("Error in launching UI : "));
- buffer.AppendNum(err);
- iTrace->Trace(buffer,KTraceFileName, __LINE__);
- iHostAddress.Zero();
- iObserver.OperationCompleteL(err);
- }
- else
- iIapDialogShown = ETrue;
- }
-
-
- }
- else
- {
- iIsTimeoutDialogTimerStarted = EFalse;
- iDialogTimer->Cancel();
- buffer.Copy(_L("Connecting to "));
- buffer.Append(iHostAddress);
- iTrace->Trace(buffer,KTraceFileName, __LINE__);
- iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,iIAPId);
- OpenConnection();
- }
- }
- else
- {
- iHostAddress.Zero();
- iObserver.OperationCompleteL(errorCode);
- }
+ TBool ret = ConvertIAPNameToIdL(iapName,iIAPId);
+ if(!ret)
+ {
+ buffer.Copy(_L("No access point configured for "));
+ buffer.Append(iHostAddress);
+ iTrace->Trace(buffer,KTraceFileName, __LINE__);
+ buffer.Copy(_L("Calling CreateConnection with no IAP"));
+ iTrace->Trace(buffer,KTraceFileName, __LINE__);
+ iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,-1);
+ OpenConnection();
+
+ }
+ else
+ {
+ buffer.Copy(_L("Connecting to "));
+ buffer.Append(iHostAddress);
+ iTrace->Trace(buffer,KTraceFileName, __LINE__);
+ iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,iIAPId);
+ OpenConnection();
+ }
+ }
+ else
+ {
+ iHostAddress.Zero();
+ iObserver.OperationCompleteL(errorCode);
+ }
}
}
-
+
+
// -----------------------------------------------------------------------------
// COMASuplConnRequestor::CreateConnection for OCC
// -----------------------------------------------------------------------------
@@ -199,9 +178,7 @@
iPrompt = aPrompt;
iWlanOnly = aWlanOnly;
iIsStaleLocIdPresent = ETrue;
- iIsTimeoutDialogTimerStarted = EFalse;
- iDialogTimer->Cancel();
-
+
TInt err;
err = iRepository->Get(KSuplGeoInfoConvServerName, GeoTagServerName);
User::LeaveIfError(err);
@@ -222,12 +199,9 @@
// -----------------------------------------------------------------------------
// COMASuplConnRequestor::OpenConnection
// -----------------------------------------------------------------------------
-//
-void COMASuplConnRequestor::CreateConnectionL(TInt aDialogTimeOutDelay)
+
+void COMASuplConnRequestor::CreateConnectionL(TInt /*aDialogTimeOutDelay*/)
{
- iIsTimeoutDialogTimerStarted = ETrue;
-
- iDialogTimer->StartTimer(aDialogTimeOutDelay);
CreateConnectionL();
}
// -----------------------------------------------------------------------------
@@ -268,8 +242,7 @@
if(iIsSettingInitilized)
{
-
- if(iConnection)
+ if(iConnection)
{
iState = EConnecting;
if(iIsStaleLocIdPresent)
@@ -456,6 +429,7 @@
void COMASuplConnRequestor::InitilizeSetting()
{
iTrace->Trace(_L("Intilizing Setting API..."), KTraceFileName, __LINE__);
+
iSuplSettings->Initialize(iStatus);
SetActive();
}
@@ -480,7 +454,10 @@
TUint COMASuplConnRequestor::GetPortNumber()
{
- return iConnection->GetPortNumberUsed();
+ if(iConnection)
+ return iConnection->GetPortNumberUsed();
+ else
+ return 0;
}
// -----------------------------------------------------------------------------
@@ -530,57 +507,7 @@
return result;
}
-// -----------------------------------------------------------------------------
-// COMASuplConnRequestor::SettingsUICompleted
-//
-// -----------------------------------------------------------------------------
-void COMASuplConnRequestor::SettingsUICompletedL(TInt aError)
- {
- TBuf<128> buffer(_L("COMASuplConnRequestor:SettingsUICompleted Error: "));
- buffer.AppendNum(aError);
- iTrace->Trace(buffer,KTraceFileName, __LINE__);
-
- if (iIsTimeoutDialogTimerStarted)
- {
- iTrace->Trace(_L("COMASuplSession::SettingsUICompleted, stopping timer "), KTraceFileName, __LINE__);
- iIsTimeoutDialogTimerStarted = EFalse;
- iDialogTimer->StopTimer();
- }
- if (iIapDlgTimerExpired)
- {
- iIapDlgTimerExpired = EFalse;
- iIapDialogShown = EFalse;
- iProtocolManager.LaunchSuplDialogTimeoutUI(this);
- iObserver.OperationCompleteL(KErrNone);
- return;
- }
- if(aError == KErrNone)
- {
- TBuf<100> IapName;
- TInt err = iProtocolManager.GetLastUsedAccessPoint(IapName,iIAPId);
- if(err == KErrNone)
- {
- buffer.Copy(_L("Connecting to "));
- buffer.Append(iHostAddress);
- buffer.Append(_L(" using IAP "));
- buffer.Append(IapName);
- iTrace->Trace(buffer,KTraceFileName, __LINE__);
- iConnection = iCommMgr.CreateConnectionL(iHostAddress,iTls,iPskTls,iPort,iIAPId);
- SaveAccessPoint(IapName);
- OpenConnection();
- }
- else
- {
- iObserver.OperationCompleteL(err);
- }
- }
- else
- {
- iObserver.OperationCompleteL(aError);
- }
-
- }
// -----------------------------------------------------------------------------
// COMASuplConnRequestor::SaveAccessPoint
@@ -646,19 +573,5 @@
iFallBackHandler->UpdateSLPListForHomeUsage(aHomeNetwork);
}
-// -----------------------------------------------------------------------------
-// COMASuplConnRequestor::DialogTimerExpiredL
-// Checks whether UI is displayed or not previously
-//
-// -----------------------------------------------------------------------------
-void COMASuplConnRequestor::DialogTimerExpiredL()
- {
- iTrace->Trace(_L("COMASuplConnRequestor:Timer Expired for SUPL IAP Dialog"), KTraceFileName, __LINE__);
- if (!iIapDialogShown)
- iProtocolManager.LaunchSuplDialogTimeoutUI(this);
- else
- iIapDlgTimerExpired = ETrue;
- return;
- }
// End of File