1383 Warning: ChooseBestIap has not been called yet" ) |
1356 Warning: ChooseBestIap has not been called yet" ) |
1384 TBMNeededAction neededAction( EPropagateError ); |
1357 TBMNeededAction neededAction( EPropagateError ); |
1385 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
1358 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
1386 return; |
1359 return; |
1387 } |
1360 } |
1388 |
1361 |
1389 // Show error popup if it's allowed per client request |
1362 // Read the Connection Id of the application |
1390 // Don't show the pop up if error code is for disconnect dialog |
1363 // |
1391 // |
1364 TConnectionId connId = iProcessErrorMessage.Int1(); |
1392 if ( !( iIapSelection->MpmConnPref().NoteBehaviour() & |
1365 |
1393 TExtendedConnPref::ENoteBehaviourConnDisableNotes ) && |
1366 MPMLOGSTRING3( "CMPMServerSession::HandleServerProcessErrorL\ |
1394 !DisconnectDlgErrorCode( error ) ) |
1367 - error code = %i, Connection Id = 0x%x", error, connId ) |
|
1368 |
|
1369 // Get the current connection IapId for this connId |
|
1370 // |
|
1371 TUint32 currentIap = iMyServer.GetBMIap( connId ); |
|
1372 |
|
1373 // Get the current connection SNAP for this Connection Id |
|
1374 // |
|
1375 TUint32 snapId = iMyServer.GetBMSnap( connId ); |
|
1376 |
|
1377 // The popup is shown if the connection is not silent and the |
|
1378 // error is something else than a disconnect dialog error code. |
|
1379 // The popup is also shown if the connection is silent and the |
|
1380 // error is a disconnect dlg error, a background application |
|
1381 // is not in question, a MMS IAP is not |
|
1382 // in question, and a started connection does not exist. |
|
1383 TBool silent = iIapSelection->MpmConnPref().NoteBehaviour() & |
|
1384 TExtendedConnPref::ENoteBehaviourConnDisableNotes; |
|
1385 if ( !silent && ( !DisconnectDlgErrorCode( error ) || |
|
1386 ( !IsBackgroundApplication( iAppUid ) && |
|
1387 !IsMMSIap( currentIap ) && |
|
1388 iMyServer.StartedConnectionExists() != KErrNotFound ) ) ) |
1395 { |
1389 { |
1396 // Note: Below function shows the discreet popup only if the error code |
1390 // Note: Below function shows the discreet popup only if the error code |
1397 // belongs to the set of errors that are shown to the user. |
1391 // belongs to the set of errors that are shown to the user. |
1398 // Otherwise the popup is not shown. |
1392 // Otherwise the popup is not shown. |
1399 iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); |
1393 iMyServer.ConnUiUtils()->ConnectionErrorDiscreetPopup( error ); |
1400 } |
1394 } |
1401 |
|
1402 // Read the Connection Id of the application |
|
1403 // |
|
1404 TConnectionId connId = iProcessErrorMessage.Int1(); |
|
1405 |
|
1406 MPMLOGSTRING3( "CMPMServerSession::HandleServerProcessErrorL\ |
|
1407 - error code = %i, Connection Id = 0x%x", error, connId ) |
|
1408 |
|
1409 // Get the current connection IapId for this connId |
|
1410 // |
|
1411 TUint32 currentIap = iMyServer.GetBMIap( connId ); |
|
1412 |
|
1413 // Get the current connection SNAP for this Connection Id |
|
1414 // |
|
1415 TUint32 snapId = iMyServer.GetBMSnap( connId ); |
|
1416 |
1395 |
1417 TConnMonIapInfo availableIAPs; |
1396 TConnMonIapInfo availableIAPs; |
1418 availableIAPs = GetAvailableIAPs(); |
1397 availableIAPs = GetAvailableIAPs(); |
1419 |
1398 |
1420 RemoveUnavailableIap( availableIAPs, currentIap ); |
1399 RemoveUnavailableIap( availableIAPs, currentIap ); |
1423 |
1402 |
1424 // Get the state of the connection for this Iap Id. |
1403 // Get the state of the connection for this Iap Id. |
1425 // |
1404 // |
1426 TConnectionState state; |
1405 TConnectionState state; |
1427 iMyServer.GetConnectionState( connId, state ); |
1406 iMyServer.GetConnectionState( connId, state ); |
|
1407 MPMLOGSTRING2( |
|
1408 "CMPMServerSession::HandleServerProcessErrorL - state %d", state ) |
1428 |
1409 |
1429 // We need to blacklist the presumed IAP too |
1410 // We need to blacklist the presumed IAP too |
1430 // |
1411 // |
1431 TUint32 presumedIap = MyServer().Events()->PresumedIapId( connId, |
1412 TUint32 presumedIap = MyServer().Events()->PresumedIapId( connId, |
1432 currentIap ); |
1413 currentIap ); |
1433 |
1414 |
1434 // Reset connection info. |
1415 // Reset connection info. |
1435 // |
1416 // |
1436 iMyServer.Events()->ResetIapConnInfo( currentIap ); |
1417 iMyServer.Events()->ResetIapConnInfo( currentIap ); |
1437 |
1418 |
1438 // Check if IAP is reported by MMS |
|
1439 // |
|
1440 TBool isMMSIap = IsMMSIap( currentIap ); |
|
1441 if ( isMMSIap ) |
|
1442 { |
|
1443 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL\ |
|
1444 - DisconnectDialog is not started because of MMS reported IAP" ) |
|
1445 } |
|
1446 |
|
1447 TInt* returnError( NULL ); |
1419 TInt* returnError( NULL ); |
1448 if ( ( state == EStarting ) || ( state == ERoaming ) ) |
1420 switch ( state ) |
1449 { |
1421 { |
1450 // Process error according to the fact that the connection |
1422 case EStarting: |
1451 // has not yet been started. |
1423 if ( ( snapId == 0 ) || ( error == KErrCancel ) ) |
1452 // |
1424 { |
1453 if ( DisconnectDlgErrorCode( error ) && |
1425 neededAction = EPropagateError; |
1454 !IsBackgroundApplication( iAppUid ) && |
1426 |
1455 !isMMSIap && |
1427 MPMLOGSTRING( |
1456 iIapSelection->MpmConnPref().DisconnectDialog() && |
1428 "CMPMServerSession::HandleServerProcessErrorL - \ |
1457 iMyServer.StartedConnectionExists() != KErrNotFound ) |
1429 Tell BM to end the client connection with appropriate error code" ) |
1458 { |
1430 } |
1459 // Start the Disconnect dialog |
1431 else |
1460 // |
1432 { |
1461 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL\ |
1433 neededAction = EDoReselection; |
1462 - Start Disconnect dialog" ) |
1434 |
1463 iDisconnectDlg = CMPMDisconnectDlg::NewL( *const_cast<CMPMServerSession*>(this), |
1435 MPMLOGSTRING( |
1464 error, |
1436 "CMPMServerSession::HandleServerProcessErrorL - \ |
1465 *MyServer().DisconnectQueue() ); |
1437 Tell BM to ignore error and do reselection" ) |
1466 iDisconnectDialogShown = ETrue; |
|
1467 return; |
|
1468 } |
|
1469 else |
|
1470 { |
|
1471 MPMLOGSTRING( "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1472 Error not handled with disconnect dialog" ) |
|
1473 |
|
1474 if ( state == EStarting ) |
|
1475 { |
|
1476 if ( ( snapId == 0 ) || ( error == KErrCancel ) ) |
|
1477 { |
|
1478 neededAction = EPropagateError; |
|
1479 |
|
1480 MPMLOGSTRING( |
|
1481 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1482 Tell BM to end the client connection with appropriate error code" ) |
|
1483 } |
|
1484 else |
|
1485 { |
|
1486 neededAction = EDoReselection; |
|
1487 |
|
1488 MPMLOGSTRING( |
|
1489 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1490 Tell BM to ignore error and do reselection" ) |
|
1491 |
|
1492 iMyServer.HandleServerBlackListIap( connId, |
|
1493 currentIap, |
|
1494 ETemporary ); |
|
1495 if ( ( presumedIap != 0 ) && |
|
1496 ( presumedIap != currentIap ) ) |
|
1497 { |
|
1498 iMyServer.HandleServerBlackListIap( connId, |
|
1499 presumedIap, |
|
1500 ETemporary ); |
|
1501 } |
|
1502 } |
|
1503 } |
|
1504 else if ( state == ERoaming ) |
|
1505 { |
|
1506 // ERoaming means commsfw stack is moving to new IAP and failed. |
|
1507 // Hence, MPM should mark to current iap as zero. |
|
1508 // |
|
1509 iMyServer.ResetBMConnection( iConnId, currentIap, *this ); |
|
1510 |
|
1511 // Notification will be sent with latest |
|
1512 // availability info |
|
1513 // |
|
1514 iStoredIapInfo.ResetStoredIapInfo(); |
|
1515 |
|
1516 neededAction = EIgnoreError; |
|
1517 |
1438 |
1518 iMyServer.HandleServerBlackListIap( connId, |
1439 iMyServer.HandleServerBlackListIap( connId, |
1519 currentIap, |
1440 currentIap, |
1520 ETemporary ); |
1441 ETemporary ); |
1521 if ( ( presumedIap != 0 ) && |
1442 if ( ( presumedIap != 0 ) && |
1522 ( presumedIap != currentIap ) ) |
1443 ( presumedIap != currentIap ) ) |
1523 { |
1444 { |
1524 iMyServer.HandleServerBlackListIap( connId, |
1445 iMyServer.HandleServerBlackListIap( connId, |
1525 presumedIap, |
1446 presumedIap, |
1526 ETemporary ); |
1447 ETemporary ); |
1527 } |
1448 } |
1528 TRAP( error, PrefIAPNotificationL( availableIAPs, |
1449 } |
1529 EBearerMan ) ); |
|
1530 if ( error == KErrNotFound ) |
|
1531 { |
|
1532 neededAction = EPropagateError; |
|
1533 |
|
1534 returnError = &error; |
|
1535 |
|
1536 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1537 EMPMMobilityErrorNotification ) ); |
|
1538 MPMLOGSTRING( |
|
1539 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1540 Tell BM to end the client connection with appropriate error code" ) |
|
1541 } |
|
1542 else |
|
1543 { |
|
1544 MPMLOGSTRING( |
|
1545 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1546 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
|
1547 } |
|
1548 } |
|
1549 else |
|
1550 { |
|
1551 MPMLOGSTRING2( |
|
1552 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1553 Unknown state %d", state ) |
|
1554 } |
|
1555 |
|
1556 // Error might be different from KErrNone if there |
1450 // Error might be different from KErrNone if there |
1557 // is no preferred IAP among the available IAPs. |
1451 // is no preferred IAP among the available IAPs. |
1558 // |
1452 // |
1559 ProcessErrorComplete( KErrNone, |
1453 ProcessErrorComplete( KErrNone, |
1560 returnError, |
1454 returnError, |
1561 &neededAction ); |
1455 &neededAction ); |
1562 return; |
1456 break; |
1563 } |
1457 |
1564 } |
1458 case ERoaming: |
1565 else if ( state == EStarted ) |
1459 // ERoaming means commsfw stack is moving to new IAP and failed. |
1566 { |
1460 // Hence, MPM should mark to current iap as zero. |
1567 // Process error according to the fact that the connection |
|
1568 // has already been started. |
|
1569 // |
|
1570 if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) ) |
|
1571 { |
|
1572 neededAction = EPropagateError; |
|
1573 |
|
1574 MPMLOGSTRING( |
|
1575 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1576 Tell BM to end the client connection with appropriate error code" ) |
|
1577 |
|
1578 // Send error notification. |
|
1579 // Not sent if connection not registered |
|
1580 // |
|
1581 TRAP_IGNORE( ErrorNotificationL( error, |
|
1582 EMPMMobilityErrorNotification ) ) |
|
1583 } |
|
1584 else if ( iPreferredIAPRequested ) |
|
1585 { |
|
1586 // IAP connection |
|
1587 // |
1461 // |
1588 if( snapId == 0 ) |
1462 iMyServer.ResetBMConnection( iConnId, currentIap, *this ); |
|
1463 |
|
1464 // Notification will be sent with latest |
|
1465 // availability info |
|
1466 // |
|
1467 iStoredIapInfo.ResetStoredIapInfo(); |
|
1468 |
|
1469 neededAction = EIgnoreError; |
|
1470 |
|
1471 iMyServer.HandleServerBlackListIap( connId, |
|
1472 currentIap, |
|
1473 ETemporary ); |
|
1474 if ( ( presumedIap != 0 ) && |
|
1475 ( presumedIap != currentIap ) ) |
|
1476 { |
|
1477 iMyServer.HandleServerBlackListIap( connId, |
|
1478 presumedIap, |
|
1479 ETemporary ); |
|
1480 } |
|
1481 TRAP( error, PrefIAPNotificationL( availableIAPs, |
|
1482 EBearerMan ) ); |
|
1483 if ( error == KErrNotFound ) |
1589 { |
1484 { |
1590 neededAction = EPropagateError; |
1485 neededAction = EPropagateError; |
1591 |
1486 |
|
1487 returnError = &error; |
|
1488 |
|
1489 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1490 EMPMMobilityErrorNotification ) ); |
1592 MPMLOGSTRING( |
1491 MPMLOGSTRING( |
1593 "CMPMServerSession::HandleServerProcessErrorL - \ |
1492 "CMPMServerSession::HandleServerProcessErrorL - \ |
1594 Tell BM to end the client connection with appropriate error code" ) |
1493 Tell BM to end the client connection with appropriate error code" ) |
1595 |
1494 } |
1596 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1597 EMPMMobilityErrorNotification ) ) |
|
1598 } |
|
1599 // SNAP connection |
|
1600 // |
|
1601 else |
1495 else |
1602 { |
1496 { |
1603 // If this has been WLAN IAP and the SNAP contains |
1497 MPMLOGSTRING( |
1604 // other WLAN IAPs, we need to perform WLAN scan before |
1498 "CMPMServerSession::HandleServerProcessErrorL - \ |
1605 // knowing the availability of those |
1499 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
|
1500 } |
|
1501 |
|
1502 // Error might be different from KErrNone if there |
|
1503 // is no preferred IAP among the available IAPs. |
|
1504 // |
|
1505 ProcessErrorComplete( KErrNone, |
|
1506 returnError, |
|
1507 &neededAction ); |
|
1508 break; |
|
1509 |
|
1510 case EStarted: |
|
1511 // Process error according to the fact that the connection |
|
1512 // has already been started. |
|
1513 // |
|
1514 if ( ( error == KErrCancel ) || ( error == KErrTimedOut ) ) |
|
1515 { |
|
1516 neededAction = EPropagateError; |
|
1517 |
|
1518 MPMLOGSTRING( |
|
1519 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1520 Tell BM to end the client connection with appropriate error code" ) |
|
1521 |
|
1522 // Send error notification. |
|
1523 // Not sent if connection not registered |
|
1524 // |
|
1525 TRAP_IGNORE( ErrorNotificationL( error, |
|
1526 EMPMMobilityErrorNotification ) ) |
|
1527 } |
|
1528 else if ( iPreferredIAPRequested ) |
|
1529 { |
|
1530 // IAP connection |
1606 // |
1531 // |
1607 RArray<TUint> iapPath; |
1532 if( snapId == 0 ) |
1608 CleanupClosePushL( iapPath ); |
1533 { |
1609 |
1534 neededAction = EPropagateError; |
1610 iMyServer.HandleServerBlackListIap( connId, |
1535 |
|
1536 MPMLOGSTRING( |
|
1537 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1538 Tell BM to end the client connection with appropriate error code" ) |
|
1539 |
|
1540 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1541 EMPMMobilityErrorNotification ) ) |
|
1542 } |
|
1543 // SNAP connection |
|
1544 // |
|
1545 else |
|
1546 { |
|
1547 // If this has been WLAN IAP and the SNAP contains |
|
1548 // other WLAN IAPs, we need to perform WLAN scan before |
|
1549 // knowing the availability of those |
|
1550 // |
|
1551 RArray<TUint> iapPath; |
|
1552 CleanupClosePushL( iapPath ); |
|
1553 |
|
1554 iMyServer.HandleServerBlackListIap( connId, |
1611 currentIap, |
1555 currentIap, |
1612 ETemporary ); |
1556 ETemporary ); |
1613 if ( ( presumedIap != 0 ) && |
1557 if ( ( presumedIap != 0 ) && |
1614 ( presumedIap != currentIap ) ) |
1558 ( presumedIap != currentIap ) ) |
1615 { |
1559 { |
1616 iMyServer.HandleServerBlackListIap( connId, |
1560 iMyServer.HandleServerBlackListIap( connId, |
1617 presumedIap, |
1561 presumedIap, |
1618 ETemporary ); |
1562 ETemporary ); |
1619 } |
1563 } |
1620 |
1564 |
1621 // current iap is WLAN |
1565 // current iap is WLAN |
1622 // |
|
1623 if( ( iMyServer.CommsDatAccess()->CheckWlanL( currentIap ) != ENotWlanIap ) && |
|
1624 iMyServer.CommsDatAccess()->SnapContainsWlanL( snapId, iapPath, KMPMNrWlansTwo ) ) |
|
1625 { |
|
1626 // perform WLAN scan |
|
1627 // message is completed in callback function |
|
1628 // ProcessErrorWlanScanCompletedL |
|
1629 // |
1566 // |
1630 iMyServer.Events()->ScanWLANNetworksL( this, |
1567 if( ( iMyServer.CommsDatAccess()->CheckWlanL( currentIap ) != ENotWlanIap ) && |
|
1568 iMyServer.CommsDatAccess()->SnapContainsWlanL( snapId, iapPath, KMPMNrWlansTwo ) ) |
|
1569 { |
|
1570 // perform WLAN scan |
|
1571 // message is completed in callback function |
|
1572 // ProcessErrorWlanScanCompletedL |
|
1573 // |
|
1574 iMyServer.Events()->ScanWLANNetworksL( this, |
1631 ConnectionId(), |
1575 ConnectionId(), |
1632 EWlanScanCallbackProcessErr ); |
1576 EWlanScanCallbackProcessErr ); |
|
1577 CleanupStack::PopAndDestroy( &iapPath ); |
|
1578 return; |
|
1579 } |
|
1580 |
1633 CleanupStack::PopAndDestroy( &iapPath ); |
1581 CleanupStack::PopAndDestroy( &iapPath ); |
1634 return; |
1582 neededAction = EIgnoreError; |
|
1583 |
|
1584 TRAPD( err2, PrefIAPNotificationL( availableIAPs, EBearerMan ) ); |
|
1585 if ( err2 == KErrNotFound ) |
|
1586 { |
|
1587 error = err2; |
|
1588 neededAction = EPropagateError; |
|
1589 |
|
1590 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
|
1591 EMPMMobilityErrorNotification ) ) |
|
1592 MPMLOGSTRING( |
|
1593 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1594 Tell BM to end the client connection with appropriate error code" ) |
|
1595 } |
|
1596 else |
|
1597 { |
|
1598 MPMLOGSTRING( |
|
1599 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1600 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
|
1601 } |
1635 } |
1602 } |
1636 |
1603 } |
1637 CleanupStack::PopAndDestroy( &iapPath ); |
1604 else |
1638 neededAction = EIgnoreError; |
1605 { |
1639 |
1606 neededAction = EPropagateError; |
1640 TRAPD( err2, PrefIAPNotificationL( availableIAPs, EBearerMan ) ); |
1607 |
1641 if ( err2 == KErrNotFound ) |
1608 MPMLOGSTRING( |
1642 { |
1609 "CMPMServerSession::HandleServerProcessErrorL - \ |
1643 error = err2; |
1610 Tell BM to end the client connection with appropriate error code" ) |
1644 neededAction = EPropagateError; |
1611 |
1645 |
1612 } |
1646 TRAP_IGNORE( ErrorNotificationL( KErrNotFound, |
1613 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
1647 EMPMMobilityErrorNotification ) ) |
1614 break; |
1648 MPMLOGSTRING( |
1615 |
1649 "CMPMServerSession::HandleServerProcessErrorL - \ |
1616 default: |
1650 Tell BM to end the client connection with appropriate error code" ) |
1617 MPMLOGSTRING2( |
1651 } |
1618 "CMPMServerSession::HandleServerProcessErrorL Unknown state %d", |
1652 else |
1619 state ) |
1653 { |
1620 ProcessErrorComplete( KErrCorrupt, |
1654 MPMLOGSTRING( |
1621 NULL, |
1655 "CMPMServerSession::HandleServerProcessErrorL - \ |
1622 NULL ); |
1656 Tell BM to ignore error and let MPM notify application about preferred IAP" ) |
1623 break; |
1657 } |
|
1658 } |
|
1659 } |
|
1660 else |
|
1661 { |
|
1662 neededAction = EPropagateError; |
|
1663 |
|
1664 MPMLOGSTRING( |
|
1665 "CMPMServerSession::HandleServerProcessErrorL - \ |
|
1666 Tell BM to end the client connection with appropriate error code" ) |
|
1667 |
|
1668 } |
|
1669 ProcessErrorComplete( KErrNone, &error, &neededAction ); |
|
1670 |
|
1671 } |
|
1672 else |
|
1673 { |
|
1674 MPMLOGSTRING2( |
|
1675 "CMPMServerSession::HandleServerProcessErrorL Unknown state %d", |
|
1676 state ) |
|
1677 ProcessErrorComplete( KErrCorrupt, |
|
1678 NULL, |
|
1679 NULL ); |
|
1680 } |
1624 } |
1681 } |
1625 } |
1682 |
1626 |
1683 // ----------------------------------------------------------------------------- |
1627 // ----------------------------------------------------------------------------- |
1684 // CMPMServerSession::HandleServerRegisterPrefIAPNotifL |
1628 // CMPMServerSession::HandleServerRegisterPrefIAPNotifL |