110 // CMPMServerSession::~CMPMServerSession |
105 // CMPMServerSession::~CMPMServerSession |
111 // ----------------------------------------------------------------------------- |
106 // ----------------------------------------------------------------------------- |
112 // |
107 // |
113 CMPMServerSession::~CMPMServerSession() |
108 CMPMServerSession::~CMPMServerSession() |
114 { |
109 { |
115 delete iConfirmDlgRoaming; |
110 |
116 delete iIapSelection; |
|
117 |
111 |
118 // Remove serverside objects for notification session. |
112 // Remove serverside objects for notification session. |
119 // |
113 // |
120 iMyServer.RemoveSession( this ); |
114 iMyServer.RemoveSession( this ); |
121 |
115 |
122 if (VpnUserConnectionUsed()) |
116 if (UserConnection()) |
123 { |
|
124 SetVpnUserConnectionUsed( EFalse ); |
|
125 |
|
126 MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession -\ |
|
127 VPN user connection usage ended" ) |
|
128 } |
|
129 else if (UserConnection()) |
|
130 { |
117 { |
131 iMyServer.ClearUserConnection(); |
118 iMyServer.ClearUserConnection(); |
132 ClearUserConnection(); |
119 ClearUserConnection(); |
133 |
120 |
134 MPMLOGSTRING( "CMPMServerSession::~CMPMServerSession -\ |
121 // Set PS keys to zero |
|
122 RProperty::Set( KMPMUserConnectionCategory, |
|
123 KMPMPSKeyUserConnectionSnap, |
|
124 0 ); |
|
125 |
|
126 RProperty::Set( KMPMUserConnectionCategory, |
|
127 KMPMPSKeyUserConnectionIap, |
|
128 0 ); |
|
129 |
|
130 MPMLOGSTRING( "CMPMServerSession::HandleServerApplicationConnectionEnds -\ |
135 User connection deactivated" ) |
131 User connection deactivated" ) |
136 } |
132 } |
137 |
133 |
138 // Clean up the blacklist table |
134 // Clean up the blacklist table |
139 iMyServer.HandleServerUnblackListIap( iConnId, 0 ); |
135 iMyServer.HandleServerUnblackListIap( iConnId, 0 ); |
140 |
136 |
141 // Make sure the connection is removed from server's information array. |
137 // Make sure the connection is removed from server's information array. |
142 iMyServer.RemoveBMConnection( iConnId, *this ); |
138 iMyServer.RemoveBMConnection( iConnId, *this ); |
143 |
139 |
144 // Cancel discreet popup |
140 delete iDisconnectDlg; |
145 iMyServer.ConnUiUtils()->CancelConnectingViaDiscreetPopup(); |
141 delete iConfirmDlgRoaming; |
|
142 delete iIapSelection; |
|
143 |
146 } |
144 } |
147 |
145 |
148 |
146 |
149 // ----------------------------------------------------------------------------- |
147 // ----------------------------------------------------------------------------- |
150 // CMPMServerSession::ServiceL |
148 // CMPMServerSession::ServiceL |
422 // an error note and complete with the error code. |
420 // an error note and complete with the error code. |
423 // |
421 // |
424 if ( ! ( mpmConnPref.NoteBehaviour() & |
422 if ( ! ( mpmConnPref.NoteBehaviour() & |
425 TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) |
423 TExtendedConnPref::ENoteBehaviourConnDisableNotes ) ) |
426 { |
424 { |
427 iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); |
425 CConnectionUiUtilities* connUiUtils = NULL; |
|
426 |
|
427 TRAP_IGNORE( connUiUtils = CConnectionUiUtilities::NewL() ); |
|
428 |
|
429 if ( connUiUtils ) |
|
430 { |
|
431 connUiUtils->ConnectionErrorDiscreetPopup( error ); |
|
432 delete connUiUtils; |
|
433 connUiUtils = NULL; |
|
434 } |
428 } |
435 } |
429 |
436 |
430 MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL - Error \ |
437 MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL - Error \ |
431 while extracting TCommDbConnPref from TConnPref" ) |
438 while extracting TCommDbConnPref from TConnPref" ) |
432 aMessage.Complete( error ); |
439 aMessage.Complete( error ); |
433 return; |
440 return; |
434 } |
441 } |
435 |
442 |
436 // Store the Uid of the application to the member variable so |
443 // Store the Uid of the application to the member variable so |
437 // that it can be used when AlwaysOnline connection is being established. |
444 // that it can be used to avoid DisconnectDialog popping up when |
|
445 // AlwaysOnline connection is being established. |
438 // |
446 // |
439 iAppUid = aMessage.Int2(); |
447 iAppUid = aMessage.Int2(); |
440 |
448 |
|
449 MPMLOGSTRING2( "CMPMServerSession::HandleServerChooseIapL: \ |
|
450 Client UID = 0x%x", iAppUid ) |
|
451 |
441 if ( !iIapSelection ) |
452 if ( !iIapSelection ) |
442 { |
453 { |
443 iIapSelection = CMPMIapSelection::NewL( iMyServer.CommsDatAccess(), |
454 iIapSelection = CMPMIapSelection::NewL( iMyServer.CommsDatAccess(), |
444 this, |
455 this ); |
445 iMyServer.ConnUiUtils() ); |
|
446 } |
456 } |
447 |
457 |
448 MPMLOGSTRING3( "CMPMServerSession::HandleServerChooseIapL - iap %d \ |
458 MPMLOGSTRING3( "CMPMServerSession::HandleServerChooseIapL - iap %d \ |
449 connType %d", mpmConnPref.IapId(), mpmConnPref.ConnType() ) |
459 connType %d", mpmConnPref.IapId(), mpmConnPref.ConnType() ) |
450 |
460 |
451 |
|
452 if ( iMyServer.UseVpnUserConnection(mpmConnPref, |
|
453 AppUid()) ) |
|
454 { |
|
455 // VPN user connection needs to be used. |
|
456 TBool prepareOk = iMyServer.PrepareVpnUserConnection( mpmConnPref ); |
|
457 if ( prepareOk ) |
|
458 { |
|
459 SetVpnUserConnectionUsed( ETrue ); |
|
460 MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL -\ |
|
461 VPN user connection used" ) |
|
462 } |
|
463 } |
|
464 |
|
465 iIapSelection->ChooseIapL( mpmConnPref ); |
461 iIapSelection->ChooseIapL( mpmConnPref ); |
466 |
462 |
467 if ( iAppUid == iMyServer.CsIdWatcher()->ConnectScreenId() ) |
463 if ( iAppUid == iMyServer.CsIdWatcher()->ConnectScreenId() ) |
468 { |
464 { |
469 MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL -\ |
465 MPMLOGSTRING( "CMPMServerSession::HandleServerChooseIapL -\ |
1394 { |
1425 { |
1395 iMyServer.PanicClient( KErrBadDescriptor ); |
1426 iMyServer.PanicClient( KErrBadDescriptor ); |
1396 return; |
1427 return; |
1397 } |
1428 } |
1398 |
1429 |
1399 if ( !ChooseBestIapCalled() ) |
|
1400 { |
|
1401 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1402 Warning: ChooseBestIap has not been called yet" ) |
|
1403 TBMNeededAction neededAction( EPropagateError ); |
|
1404 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
|
1405 return; |
|
1406 } |
|
1407 |
|
1408 // Read the Connection Id of the application |
1430 // Read the Connection Id of the application |
1409 // |
1431 // |
1410 TConnectionId connId = iProcessErrorMessage.Int1(); |
1432 TConnectionId connId = iProcessErrorMessage.Int1(); |
1411 |
1433 |
1412 MPMLOGSTRING3( "CMPMServerSession::HandleServerProcessErrorL\ |
1434 MPMLOGSTRING3( "CMPMServerSession::HandleServerProcessErrorL \ |
1413 - error code = %i, Connection Id = 0x%x", error, connId ) |
1435 - error code = %i, Connection Id = 0x%x", error, connId ) |
|
1436 |
|
1437 if ( !ChooseBestIapCalled() ) |
|
1438 { |
|
1439 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1440 ChooseBestIap has not been called yet" ) |
|
1441 |
|
1442 // If it is not disconnect dialog error then complete message. |
|
1443 // If it is then leave message pending and it will be completed when |
|
1444 // disconnect dialog completes in other session. |
|
1445 if ( !DisconnectDlgErrorCode( error ) ) |
|
1446 { |
|
1447 TBMNeededAction neededAction( EPropagateError ); |
|
1448 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
|
1449 } |
|
1450 else |
|
1451 { |
|
1452 MPMLOGSTRING( "Disconnect dlg error - leave msg pending" ); |
|
1453 } |
|
1454 return; |
|
1455 } |
|
1456 |
|
1457 // Show error popup if it's allowed per client request |
|
1458 // Don't show the pop up if error code is for disconnect dialog |
|
1459 // |
|
1460 if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & |
|
1461 TExtendedConnPref::ENoteBehaviourConnDisableNotes ) && |
|
1462 !DisconnectDlgErrorCode( error ) ) |
|
1463 { |
|
1464 CConnectionUiUtilities* connUiUtils = NULL; |
|
1465 TRAPD( popupCreateError, connUiUtils = CConnectionUiUtilities::NewL() ); |
|
1466 if ( popupCreateError == KErrNone && connUiUtils ) |
|
1467 { |
|
1468 // Note: Below function shows the discreet popup only if the error code |
|
1469 // belongs to the set of errors that are shown to the user. |
|
1470 // Otherwise the popup is not shown. |
|
1471 connUiUtils->ConnectionErrorDiscreetPopup( error ); |
|
1472 delete connUiUtils; |
|
1473 connUiUtils = NULL; |
|
1474 |
|
1475 // Error discreet popup has been shown. This is needed so that we |
|
1476 // dont show it again for SNAP. |
|
1477 iErrorDiscreetPopupShown = ETrue; |
|
1478 } |
|
1479 } |
1414 |
1480 |
1415 // Get the current connection IapId for this connId |
1481 // Get the current connection IapId for this connId |
1416 // |
1482 // |
1417 TUint32 currentIap = iMyServer.GetBMIap( connId ); |
1483 TUint32 currentIap = iMyServer.GetBMIap( connId ); |
1418 |
1484 |
1419 // Get the current connection SNAP for this Connection Id |
1485 // Get the current connection SNAP for this Connection Id |
1420 // |
1486 // |
1421 TUint32 snapId = iMyServer.GetBMSnap( connId ); |
1487 TUint32 snapId = iMyServer.GetBMSnap( connId ); |
1422 |
|
1423 // The popup is shown if the connection is not silent and the |
|
1424 // error is something else than a disconnect dialog error code. |
|
1425 // The popup is also shown if the connection is silent and the |
|
1426 // error is a disconnect dlg error, a background application |
|
1427 // is not in question, a MMS IAP is not |
|
1428 // in question, and a started connection does not exist. |
|
1429 TBool silent = iIapSelection->MpmConnPref().NoteBehaviour() & |
|
1430 TExtendedConnPref::ENoteBehaviourConnDisableNotes; |
|
1431 if ( !silent && ( !DisconnectDlgErrorCode( error ) || |
|
1432 ( !IsBackgroundApplication( iAppUid ) && |
|
1433 !IsMMSIap( currentIap ) && |
|
1434 iMyServer.StartedConnectionExists() != KErrNotFound ) ) ) |
|
1435 { |
|
1436 // Note: Below function shows the discreet popup only if the error code |
|
1437 // belongs to the set of errors that are shown to the user. |
|
1438 // Otherwise the popup is not shown. |
|
1439 iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); |
|
1440 |
|
1441 // Error discreet popup has been shown. This is needed so that we |
|
1442 // dont show it again for SNAP. |
|
1443 iErrorDiscreetPopupShown = ETrue; |
|
1444 } |
|
1445 |
1488 |
1446 TConnMonIapInfo availableIAPs; |
1489 TConnMonIapInfo availableIAPs; |
1447 availableIAPs = GetAvailableIAPs(); |
1490 availableIAPs = GetAvailableIAPs(); |
1448 |
1491 |
1449 RemoveUnavailableIap( availableIAPs, currentIap ); |
1492 RemoveUnavailableIap( availableIAPs, currentIap ); |
1452 |
1495 |
1453 // Get the state of the connection for this Iap Id. |
1496 // Get the state of the connection for this Iap Id. |
1454 // |
1497 // |
1455 TConnectionState state; |
1498 TConnectionState state; |
1456 iMyServer.GetConnectionState( connId, state ); |
1499 iMyServer.GetConnectionState( connId, state ); |
1457 MPMLOGSTRING2( |
|
1458 "CMPMServerSession::HandleServerProcessErrorL - state %d", state ) |
|
1459 |
1500 |
1460 // We need to blacklist the presumed IAP too |
1501 // We need to blacklist the presumed IAP too |
1461 // |
1502 // |
1462 TUint32 presumedIap = MyServer().Events()->PresumedIapId( connId, |
1503 TUint32 presumedIap = MyServer().Events()->PresumedIapId( connId, |
1463 currentIap ); |
1504 currentIap ); |
1464 |
1505 |
1465 // Reset connection info. |
1506 // Reset connection info. |
1466 // |
1507 // |
1467 iMyServer.Events()->ResetIapConnInfo( currentIap ); |
1508 iMyServer.Events()->ResetIapConnInfo( currentIap ); |
1468 |
1509 |
|
1510 // Check if IAP is reported by MMS |
|
1511 // |
|
1512 TBool isMMSIap = IsMMSIap( currentIap ); |
|
1513 if ( isMMSIap ) |
|
1514 { |
|
1515 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL\ |
|
1516 - DisconnectDialog is not started because of MMS reported IAP" ) |
|
1517 } |
|
1518 |
1469 TInt* returnError( NULL ); |
1519 TInt* returnError( NULL ); |
1470 switch ( state ) |
1520 if ( ( state == EStarting ) || ( state == ERoaming ) ) |
1471 { |
1521 { |
1472 case EStarting: |
1522 // Process error according to the fact that the connection |
1473 if ( ( snapId == 0 ) || ( error == KErrCancel ) ) |
1523 // has not yet been started. |
1474 { |
1524 // |
1475 neededAction = EPropagateError; |
1525 if ( DisconnectDlgErrorCode( error ) && |
1476 |
1526 !IsBackgroundApplication( iAppUid ) && |
1477 MPMLOGSTRING( |
1527 !isMMSIap && |
1478 "CMPMServerSession::HandleServerProcessErrorL - \ |
1528 iIapSelection->MpmConnPref().DisconnectDialog() && |
1479 Tell BM to end the client connection with appropriate error code" ) |
1529 iMyServer.StartedConnectionExists() != KErrNotFound ) |
1480 } |
1530 { |
1481 else |
1531 // Start the Disconnect dialog |
1482 { |
1532 // |
1483 neededAction = EDoReselection; |
1533 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL\ |
1484 |
1534 - Start Disconnect dialog" ) |
1485 MPMLOGSTRING( |
1535 iDisconnectDlg = CMPMDisconnectDlg::NewL( *const_cast<CMPMServerSession*>(this), |
1486 "CMPMServerSession::HandleServerProcessErrorL - \ |
1536 error, |
1487 Tell BM to ignore error and do reselection" ) |
1537 *MyServer().DisconnectQueue() ); |
|
1538 iDisconnectDialogShown = ETrue; |
|
1539 return; |
|
1540 } |
|
1541 else |
|
1542 { |
|
1543 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1544 Error not handled with disconnect dialog" ) |
|
1545 |
|
1546 if ( state == EStarting ) |
|
1547 { |
|
1548 if ( ( snapId == 0 ) || ( error == KErrCancel ) ) |
|
1549 { |
|
1550 neededAction = EPropagateError; |
|
1551 |
|
1552 MPMLOGSTRING( |
|
1553 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1554 Tell BM to end the client connection with appropriate error code" ) |
|
1555 } |
|
1556 else |
|
1557 { |
|
1558 neededAction = EDoReselection; |
|
1559 |
|
1560 MPMLOGSTRING( |
|
1561 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1562 Tell BM to ignore error and do reselection" ) |
|
1563 |
|
1564 iMyServer.HandleServerBlackListIap( connId, |
|
1565 currentIap, |
|
1566 ETemporary ); |
|
1567 if ( ( presumedIap != 0 ) && |
|
1568 ( presumedIap != currentIap ) ) |
|
1569 { |
|
1570 iMyServer.HandleServerBlackListIap( connId, |
|
1571 presumedIap, |
|
1572 ETemporary ); |
|
1573 } |
|
1574 } |
|
1575 } |
|
1576 else if ( state == ERoaming ) |
|
1577 { |
|
1578 // ERoaming means commsfw stack is moving to new IAP and failed. |
|
1579 // Hence, MPM should mark to current iap as zero. |
|
1580 // |
|
1581 iMyServer.ResetBMConnection( iConnId, currentIap, *this ); |
|
1582 |
|
1583 // Notification will be sent with latest |
|
1584 // availability info |
|
1585 // |
|
1586 iStoredIapInfo.ResetStoredIapInfo(); |
|
1587 |
|
1588 neededAction = EIgnoreError; |
1488 |
1589 |
1489 iMyServer.HandleServerBlackListIap( connId, |
1590 iMyServer.HandleServerBlackListIap( connId, |
1490 currentIap, |
1591 currentIap, |
1491 ETemporary ); |
1592 ETemporary ); |
1492 if ( ( presumedIap != 0 ) && |
1593 if ( ( presumedIap != 0 ) && |
1493 ( presumedIap != currentIap ) ) |
1594 ( presumedIap != currentIap ) ) |
1494 { |
1595 { |
1495 iMyServer.HandleServerBlackListIap( connId, |
1596 iMyServer.HandleServerBlackListIap( connId, |
1496 presumedIap, |
1597 presumedIap, |
1497 ETemporary ); |
1598 ETemporary ); |
1498 } |
1599 } |
1499 } |
1600 TRAP( error, PrefIAPNotificationL( availableIAPs, |
|
1601 EBearerMan ) ); |
|
1602 if ( error == KErrNotFound ) |
|
1603 { |
|
1604 neededAction = EPropagateError; |
|
1605 |
|
1606 returnError = &error; |
|
1607 |
|
1608 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1609 EMPMMobilityErrorNotification ) ); |
|
1610 MPMLOGSTRING( |
|
1611 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1612 Tell BM to end the client connection with appropriate error code" ) |
|
1613 } |
|
1614 else |
|
1615 { |
|
1616 MPMLOGSTRING( |
|
1617 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1618 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
|
1619 } |
|
1620 } |
|
1621 else |
|
1622 { |
|
1623 MPMLOGSTRING2( |
|
1624 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1625 Unknown state %d", state ) |
|
1626 } |
|
1627 |
1500 // Error might be different from KErrNone if there |
1628 // Error might be different from KErrNone if there |
1501 // is no preferred IAP among the available IAPs. |
1629 // is no preferred IAP among the available IAPs. |
1502 // |
1630 // |
1503 ProcessErrorComplete( KErrNone, |
1631 ProcessErrorComplete( KErrNone, |
1504 returnError, |
1632 returnError, |
1505 &neededAction ); |
1633 &neededAction ); |
1506 break; |
|
1507 |
1634 |
1508 case ERoaming: |
1635 iMyServer.HandlePendingMsgs( currentIap, |
1509 // ERoaming means commsfw stack is moving to new IAP and failed. |
1636 KErrNone, |
1510 // Hence, MPM should mark to current iap as zero. |
1637 returnError, |
|
1638 &neededAction ); |
|
1639 return; |
|
1640 } |
|
1641 } |
|
1642 else if ( state == EStarted ) |
|
1643 { |
|
1644 // Process error according to the fact that the connection |
|
1645 // has already been started. |
|
1646 // KErrConnectionTerminated is received when user disconnects |
|
1647 // connection from Settings/Connection mgr. |
|
1648 // |
|
1649 if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) || ( error == KErrConnectionTerminated ) |
|
1650 || ( error == KErrDisconnected && iMyServer.IsPhoneOffline() ) ) |
|
1651 { |
|
1652 neededAction = EPropagateError; |
|
1653 |
|
1654 MPMLOGSTRING( |
|
1655 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1656 Tell BM to end the client connection with appropriate error code" ) |
|
1657 |
|
1658 // Send error notification. |
|
1659 // Not sent if connection not registered |
|
1660 // |
|
1661 TRAP_IGNORE( ErrorNotificationL( error, |
|
1662 EMPMMobilityErrorNotification ) ) |
|
1663 } |
|
1664 else if ( iPreferredIAPRequested ) |
|
1665 { |
|
1666 // IAP connection |
1511 // |
1667 // |
1512 iMyServer.ResetBMConnection( iConnId, currentIap, *this ); |
1668 if( snapId == 0 ) |
1513 |
|
1514 // Notification will be sent with latest |
|
1515 // availability info |
|
1516 // |
|
1517 iStoredIapInfo.ResetStoredIapInfo(); |
|
1518 |
|
1519 neededAction = EIgnoreError; |
|
1520 |
|
1521 iMyServer.HandleServerBlackListIap( connId, |
|
1522 currentIap, |
|
1523 ETemporary ); |
|
1524 if ( ( presumedIap != 0 ) && |
|
1525 ( presumedIap != currentIap ) ) |
|
1526 { |
|
1527 iMyServer.HandleServerBlackListIap( connId, |
|
1528 presumedIap, |
|
1529 ETemporary ); |
|
1530 } |
|
1531 TRAP( error, PrefIAPNotificationL( availableIAPs, |
|
1532 EBearerMan ) ); |
|
1533 if ( error == KErrNotFound ) |
|
1534 { |
1669 { |
1535 neededAction = EPropagateError; |
1670 neededAction = EPropagateError; |
1536 |
1671 |
1537 returnError = &error; |
|
1538 |
|
1539 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1540 EMPMMobilityErrorNotification ) ); |
|
1541 MPMLOGSTRING( |
1672 MPMLOGSTRING( |
1542 "CMPMServerSession::HandleServerProcessErrorL - \ |
1673 "CMPMServerSession::HandleServerProcessErrorL - \ |
1543 Tell BM to end the client connection with appropriate error code" ) |
1674 Tell BM to end the client connection with appropriate error code" ) |
1544 } |
1675 |
|
1676 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1677 EMPMMobilityErrorNotification ) ) |
|
1678 } |
|
1679 // SNAP connection |
|
1680 // |
1545 else |
1681 else |
1546 { |
1682 { |
1547 MPMLOGSTRING( |
1683 // If this has been WLAN IAP and the SNAP contains |
1548 "CMPMServerSession::HandleServerProcessErrorL - \ |
1684 // other WLAN IAPs, we need to perform WLAN scan before |
1549 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
1685 // knowing the availability of those |
1550 } |
1686 // |
1551 |
1687 RArray<TUint> iapPath; |
1552 // Error might be different from KErrNone if there |
1688 CleanupClosePushL( iapPath ); |
1553 // is no preferred IAP among the available IAPs. |
1689 |
1554 // |
1690 iMyServer.HandleServerBlackListIap( connId, |
1555 ProcessErrorComplete( KErrNone, |
1691 currentIap, |
1556 returnError, |
1692 ETemporary ); |
1557 &neededAction ); |
1693 if ( ( presumedIap != 0 ) && |
1558 break; |
1694 ( presumedIap != currentIap ) ) |
1559 |
1695 { |
1560 case EStarted: |
1696 iMyServer.HandleServerBlackListIap( connId, |
1561 // Process error according to the fact that the connection |
1697 presumedIap, |
1562 // has already been started. |
1698 ETemporary ); |
1563 // KErrConnectionTerminated is received when user disconnects |
1699 } |
1564 // connection from Settings/Connection mgr. |
1700 |
1565 // |
1701 // current iap is either WLAN or EasyWlan |
1566 if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) || ( error == KErrConnectionTerminated ) ) |
|
1567 { |
|
1568 neededAction = EPropagateError; |
|
1569 |
|
1570 MPMLOGSTRING( |
|
1571 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1572 Tell BM to end the client connection with appropriate error code" ) |
|
1573 |
|
1574 // Send error notification. |
|
1575 // Not sent if connection not registered |
|
1576 // |
1702 // |
1577 TRAP_IGNORE( ErrorNotificationL( error, |
1703 if( ( iMyServer.CommsDatAccess()->CheckWlanL( currentIap ) != ENotWlanIap ) && |
1578 EMPMMobilityErrorNotification ) ) |
1704 iMyServer.CommsDatAccess()->SnapContainsWlanL( snapId, iapPath, KMPMNrWlansTwo ) ) |
1579 } |
|
1580 else if ( iPreferredIAPRequested ) |
|
1581 { |
|
1582 // IAP connection |
|
1583 // |
|
1584 if( snapId == 0 ) |
|
1585 { |
1705 { |
|
1706 // perform WLAN scan |
|
1707 // message is completed in callback function |
|
1708 // ProcessErrorWlanScanCompletedL |
|
1709 // |
|
1710 iMyServer.Events()->ScanWLANNetworksL( this, |
|
1711 ConnectionId(), |
|
1712 EWlanScanCallbackProcessErr ); |
|
1713 CleanupStack::PopAndDestroy( &iapPath ); |
|
1714 return; |
|
1715 } |
|
1716 |
|
1717 CleanupStack::PopAndDestroy( &iapPath ); |
|
1718 neededAction = EIgnoreError; |
|
1719 |
|
1720 TRAPD( err2, PrefIAPNotificationL( availableIAPs, EBearerMan ) ); |
|
1721 if ( err2 == KErrNotFound ) |
|
1722 { |
|
1723 error = err2; |
1586 neededAction = EPropagateError; |
1724 neededAction = EPropagateError; |
1587 |
1725 |
|
1726 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1727 EMPMMobilityErrorNotification ) ) |
1588 MPMLOGSTRING( |
1728 MPMLOGSTRING( |
1589 "CMPMServerSession::HandleServerProcessErrorL - \ |
1729 "CMPMServerSession::HandleServerProcessErrorL - \ |
1590 Tell BM to end the client connection with appropriate error code" ) |
1730 Tell BM to end the client connection with appropriate error code" ) |
1591 |
|
1592 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1593 EMPMMobilityErrorNotification ) ) |
|
1594 } |
1731 } |
1595 // SNAP connection |
|
1596 // |
|
1597 else |
1732 else |
1598 { |
1733 { |
1599 // If this has been WLAN IAP and the SNAP contains |
1734 MPMLOGSTRING( |
1600 // other WLAN IAPs, we need to perform WLAN scan before |
1735 "CMPMServerSession::HandleServerProcessErrorL - \ |
1601 // knowing the availability of those |
1736 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
1602 // |
|
1603 RArray<TUint> iapPath; |
|
1604 CleanupClosePushL( iapPath ); |
|
1605 |
|
1606 iMyServer.HandleServerBlackListIap( connId, |
|
1607 currentIap, |
|
1608 ETemporary ); |
|
1609 if ( ( presumedIap != 0 ) && |
|
1610 ( presumedIap != currentIap ) ) |
|
1611 { |
|
1612 iMyServer.HandleServerBlackListIap( connId, |
|
1613 presumedIap, |
|
1614 ETemporary ); |
|
1615 } |
|
1616 |
|
1617 // current iap is WLAN |
|
1618 // |
|
1619 if( ( iMyServer.CommsDatAccess()->CheckWlanL( currentIap ) != ENotWlanIap ) && |
|
1620 iMyServer.CommsDatAccess()->SnapContainsWlanL( snapId, iapPath, KMPMNrWlansTwo ) ) |
|
1621 { |
|
1622 // perform WLAN scan |
|
1623 // message is completed in callback function |
|
1624 // ProcessErrorWlanScanCompletedL |
|
1625 // |
|
1626 iMyServer.Events()->ScanWLANNetworksL( this, |
|
1627 ConnectionId(), |
|
1628 EWlanScanCallbackProcessErr ); |
|
1629 CleanupStack::PopAndDestroy( &iapPath ); |
|
1630 return; |
|
1631 } |
|
1632 |
|
1633 CleanupStack::PopAndDestroy( &iapPath ); |
|
1634 neededAction = EIgnoreError; |
|
1635 |
|
1636 TRAPD( err2, PrefIAPNotificationL( availableIAPs, EBearerMan ) ); |
|
1637 if ( err2 == KErrNotFound ) |
|
1638 { |
|
1639 error = err2; |
|
1640 neededAction = EPropagateError; |
|
1641 |
|
1642 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1643 EMPMMobilityErrorNotification ) ) |
|
1644 MPMLOGSTRING( |
|
1645 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1646 Tell BM to end the client connection with appropriate error code" ) |
|
1647 } |
|
1648 else |
|
1649 { |
|
1650 MPMLOGSTRING( |
|
1651 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1652 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
|
1653 } |
|
1654 } |
1737 } |
1655 } |
1738 } |
1656 else |
1739 } |
1657 { |
1740 else |
1658 neededAction = EPropagateError; |
1741 { |
1659 |
1742 neededAction = EPropagateError; |
1660 MPMLOGSTRING( |
1743 |
1661 "CMPMServerSession::HandleServerProcessErrorL - \ |
1744 MPMLOGSTRING( |
1662 Tell BM to end the client connection with appropriate error code" ) |
1745 "CMPMServerSession::HandleServerProcessErrorL - \ |
1663 |
1746 Tell BM to end the client connection with appropriate error code" ) |
1664 } |
1747 |
1665 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
1748 } |
1666 break; |
1749 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
1667 |
1750 |
1668 default: |
1751 } |
1669 MPMLOGSTRING2( |
1752 else |
1670 "CMPMServerSession::HandleServerProcessErrorL Unknown state %d", |
1753 { |
1671 state ) |
1754 MPMLOGSTRING2( |
1672 ProcessErrorComplete( KErrCorrupt, |
1755 "CMPMServerSession::HandleServerProcessErrorL Unknown state %d", |
1673 NULL, |
1756 state ) |
1674 NULL ); |
1757 ProcessErrorComplete( KErrCorrupt, |
1675 break; |
1758 NULL, |
|
1759 NULL ); |
1676 } |
1760 } |
1677 } |
1761 } |
1678 |
1762 |
1679 // ----------------------------------------------------------------------------- |
1763 // ----------------------------------------------------------------------------- |
1680 // CMPMServerSession::HandleServerRegisterPrefIAPNotifL |
1764 // CMPMServerSession::HandleServerRegisterPrefIAPNotifL |