telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmphonetsy.cpp
branchRCL_3
changeset 14 7ef16719d8cb
parent 0 3553901f7fa8
child 16 fe8b59ab9fa0
child 20 244d7c5f118e
equal deleted inserted replaced
9:962e6306d9d2 14:7ef16719d8cb
    89     CMmMessageManagerBase* aMessageManager,
    89     CMmMessageManagerBase* aMessageManager,
    90     CMmPhoneFactoryTsy* aMmPhoneFactoryTsy,
    90     CMmPhoneFactoryTsy* aMmPhoneFactoryTsy,
    91     MLtsyFactoryBase* aFactory )
    91     MLtsyFactoryBase* aFactory )
    92     {
    92     {
    93 TFLOGSTRING2("TSY: CMmPhoneTsy::NewL - Phone model Id: %S", &KPhoneModelId);
    93 TFLOGSTRING2("TSY: CMmPhoneTsy::NewL - Phone model Id: %S", &KPhoneModelId);
       
    94     CleanupStack::PushL( aMessageManager );
    94     CMmPhoneTsy* mmPhoneTsy = new (ELeave) CMmPhoneTsy();
    95     CMmPhoneTsy* mmPhoneTsy = new (ELeave) CMmPhoneTsy();
    95 
    96 
    96     mmPhoneTsy->iMessageManager = aMessageManager;
    97     mmPhoneTsy->iMessageManager = aMessageManager;
       
    98     CleanupStack::Pop(aMessageManager);
    97     mmPhoneTsy->iMmPhoneFactory = aMmPhoneFactoryTsy;
    99     mmPhoneTsy->iMmPhoneFactory = aMmPhoneFactoryTsy;
       
   100     CleanupClosePushL( *mmPhoneTsy );
    98     //For pointer is stored for deleting licenseetsy instance
   101     //For pointer is stored for deleting licenseetsy instance
    99     mmPhoneTsy->iLtsyFactory = aFactory;
   102     mmPhoneTsy->iLtsyFactory = aFactory;
   100     mmPhoneTsy->iTelephonyAudioControl = NULL;
   103     mmPhoneTsy->iTelephonyAudioControl = NULL;
   101     if ( aFactory )
   104     if ( aFactory )
   102         {
   105         {
   113             mmPhoneTsy->iTelephonyAudioControl = 
   116             mmPhoneTsy->iTelephonyAudioControl = 
   114                 ptr_v2->GetTelephonyAudioControl( mmPhoneTsy );            
   117                 ptr_v2->GetTelephonyAudioControl( mmPhoneTsy );            
   115             }
   118             }
   116         }
   119         }
   117 
   120 
   118     CleanupClosePushL( *mmPhoneTsy );
       
   119     mmPhoneTsy->ConstructL();
   121     mmPhoneTsy->ConstructL();
   120     CleanupStack::Pop( mmPhoneTsy );
   122     CleanupStack::Pop( mmPhoneTsy );
   121     return mmPhoneTsy;
   123     return mmPhoneTsy;
   122     }
   124     }
   123 
   125 
   182 		TFLOGSTRING("TSY: HWRM Battery API is in use.");
   184 		TFLOGSTRING("TSY: HWRM Battery API is in use.");
   183 		iPowerManager = CHWRMPower::NewL();
   185 		iPowerManager = CHWRMPower::NewL();
   184 		iBattery = CBatteryInfoObserver::NewL( *iPowerManager, *this ); 
   186 		iBattery = CBatteryInfoObserver::NewL( *iPowerManager, *this ); 
   185 		iChargingStatus = CChargingStatusObserver::NewL( *this );
   187 		iChargingStatus = CChargingStatusObserver::NewL( *this );
   186 		}
   188 		}
       
   189     
       
   190     //Create the SSM Plugin Handler on creation rather than on demand to avoid problems 
       
   191     //with Emergency Calls in Out Of Memory situations.
       
   192     iSystemStatePluginHandler = CCtsySystemStatePluginHandler::NewL();
   187 	
   193 	
   188 //#ifdef __WINS__  SYMBIAN commented out
   194 //#ifdef __WINS__  SYMBIAN commented out
   189 //   iMmPhoneExtInterface->NotifySimStatusReadyL();
   195 //   iMmPhoneExtInterface->NotifySimStatusReadyL();
   190 //#endif
   196 //#endif
   191     }
   197     }
   543     iRetAPNEntries = NULL;
   549     iRetAPNEntries = NULL;
   544 	iRetAPNname = NULL;
   550 	iRetAPNname = NULL;
   545     iRetAclStatus = NULL;
   551     iRetAclStatus = NULL;
   546     iSetAclStatus = NULL;
   552     iSetAclStatus = NULL;
   547     iRetNotifyAclStatus = NULL;
   553     iRetNotifyAclStatus = NULL;
       
   554     
       
   555     if ( iSystemStatePluginHandler )
       
   556         {
       
   557         iSystemStatePluginHandler->Close();
       
   558         delete iSystemStatePluginHandler;
       
   559         }
       
   560     iSystemStatePluginHandler = NULL;
   548 TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
   561 TFLOGSTRING("TSY: CMmPhoneTsy::~CMmPhoneTsy DONE");
   549    }
   562    }
   550 
   563 
   551 // ---------------------------------------------------------------------------
   564 // ---------------------------------------------------------------------------
   552 // CMmPhoneTsy::Init
   565 // CMmPhoneTsy::Init
   685     {
   698     {
   686     // If ADN or FDN phone book storage is created, then start to fetch
   699     // If ADN or FDN phone book storage is created, then start to fetch
   687     // entries from SIM into cache.
   700     // entries from SIM into cache.
   688     for( TInt i = 0; i < iPBList->GetNumberOfObjects(); i++ )
   701     for( TInt i = 0; i < iPBList->GetNumberOfObjects(); i++ )
   689         {
   702         {
   690         //Get pbStore object
   703         // Get pbStore object
   691         CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
   704         CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
   692         //Check if the current PB is the object that we are trying to find.
   705         // Notify the store that the SIM is ready
   693         //If both names are exactly the same, CompareF returns 0.
   706         pbStore->SimIsReady();
   694         if ( 0 == pbStore->PhoneBookName()->CompareF( KETelIccAdnPhoneBook ) )
       
   695             {
       
   696 TFLOGSTRING("TSY: CMmPhoneTsy::StartPBCachingL - Start to read ADN entries");
       
   697             //Start to cache phonebook entries.
       
   698             pbStore->CacheEntriesL();
       
   699             }
       
   700         //If current PB is FDN
       
   701         else if ( 0 == pbStore->PhoneBookName()->CompareF( 
       
   702             KETelIccFdnPhoneBook ) )
       
   703             {
       
   704 TFLOGSTRING("TSY: CMmPhoneTsy::StartPBCaching - Start to read FDN entries" );
       
   705             //Start to cache phonebook entries.
       
   706             pbStore->CacheEntriesL();
       
   707             }
       
   708         }
   707         }
   709     }
   708     }
   710 
   709 
   711 // ---------------------------------------------------------------------------
   710 // ---------------------------------------------------------------------------
   712 // CMmPhoneTsy::NotifyIndicatorChange
   711 // CMmPhoneTsy::NotifyIndicatorChange
  5684             // Unpack entry parameter
  5683             // Unpack entry parameter
  5685             RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg* entryPckg =
  5684             RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg* entryPckg =
  5686             REINTERPRET_CAST
  5685             REINTERPRET_CAST
  5687             ( RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg*, aMailBox );
  5686             ( RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg*, aMailBox );
  5688             
  5687             
  5689             RMobilePhone::TMobilePhoneVoicemailIdsV3& mailboxData = 
  5688             iMailboxData = ( *entryPckg )();
  5690               ( *entryPckg )();
  5689 
  5691 
  5690             if ( KETelExtMultimodeV3 == iMailboxData.ExtensionId() )
  5692             if ( KETelExtMultimodeV3 == mailboxData.ExtensionId() )
       
  5693                 {
  5691                 {
  5694                 // Save pointer to client space
  5692                 // Save pointer to client space
  5695                 iMailBoxData = aMailBox;
  5693                 iMailBoxData = aMailBox;
  5696 
  5694 
       
  5695                 // Check that VMBX book store was initilized...
       
  5696                 TBool found = EFalse;
       
  5697                 for( TInt i = 0; (!found) && (i < iPBList->GetNumberOfObjects()); i++ )
       
  5698                     {
       
  5699                     //Get pbStore object
       
  5700                     CMmPhoneBookStoreTsy* pbStore = iPBList->GetMmPBByIndex( i );
       
  5701                     //Check if the current PB is the object that we are trying to find.
       
  5702                     if ( 0 == pbStore->PhoneBookName()->CompareF( KETelIccVoiceMailBox ) )
       
  5703                         {
       
  5704                         found = ETrue;
       
  5705                         if( !pbStore->IsPBInitDone() )
       
  5706                             {
       
  5707                             TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox initilizing was not complete... Waiting for completion");
       
  5708                             iReqHandleType = EMultimodePhoneGetMailboxNumbers;
       
  5709                             return KErrNone;
       
  5710                             }
       
  5711                         }
       
  5712                     }
       
  5713                 if(!found)
       
  5714                     {
       
  5715                     TFLOGSTRING("TSY: CMmPhoneTsy::GetMailboxNumbersL VoiceMailBox should be created...");
       
  5716                     iMmPhoneBookStoreTsy = 
       
  5717                         CMmPhoneBookStoreTsy::NewL( this, KETelIccVoiceMailBox );
       
  5718                     
       
  5719                     TInt addPBSucceeded = iPBList->AddObject( iMmPhoneBookStoreTsy );
       
  5720                     if( !iMmPhoneBookStoreTsy->IsPBInitDone() )
       
  5721                         {
       
  5722                         iReqHandleType = EMultimodePhoneGetMailboxNumbers;
       
  5723                         return addPBSucceeded;
       
  5724                         }
       
  5725                     }
       
  5726                 
       
  5727 
  5697                 CMmDataPackage mailBoxDataPackage;
  5728                 CMmDataPackage mailBoxDataPackage;
  5698                 mailBoxDataPackage.PackData( &mailboxData );
  5729                 mailBoxDataPackage.PackData( &iMailboxData );
  5699 
  5730 
  5700                 ret = ( MessageManager()->HandleRequestL(
  5731                 ret = ( MessageManager()->HandleRequestL(
  5701                     EMobilePhoneGetMailboxNumbers, &mailBoxDataPackage ) );
  5732                     EMobilePhoneGetMailboxNumbers, &mailBoxDataPackage ) );
  5702 
  5733 
  5703                 // Store request handle if KErrNone
  5734                 // Store request handle if KErrNone
  6652     {
  6683     {
  6653     return iMmSupplServTsy;
  6684     return iMmSupplServTsy;
  6654     }
  6685     }
  6655 
  6686 
  6656 // ---------------------------------------------------------------------------
  6687 // ---------------------------------------------------------------------------
  6657 // CMmPhoneTsy::HandleType
       
  6658 // Returns req handle type
       
  6659 // (other items were commented in a header).
       
  6660 // ---------------------------------------------------------------------------
       
  6661 //
       
  6662 CMmPhoneTsy::TPhoneRequestTypes CMmPhoneTsy::HandleType()
       
  6663     {
       
  6664     return iReqHandleType;
       
  6665     }
       
  6666 
       
  6667 // ---------------------------------------------------------------------------
       
  6668 // CMmPhoneTsy::GetSecurityTsy
  6688 // CMmPhoneTsy::GetSecurityTsy
  6669 //  Returns SecurityTsy instance
  6689 //  Returns SecurityTsy instance
  6670 // (other items were commented in a header).
  6690 // (other items were commented in a header).
  6671 // ---------------------------------------------------------------------------
  6691 // ---------------------------------------------------------------------------
  6672 //
  6692 //
  7934     {   
  7954     {   
  7935 TFLOGSTRING2("TSY: CMmPhoneTsy::IsModemStatusReady: %i", iIsModemReady );
  7955 TFLOGSTRING2("TSY: CMmPhoneTsy::IsModemStatusReady: %i", iIsModemReady );
  7936     
  7956     
  7937     return iIsModemReady;
  7957     return iIsModemReady;
  7938     }
  7958     }
       
  7959 	
       
  7960 // ---------------------------------------------------------------------------
       
  7961 // CMmPhoneTsy::PhoneBookStoreInitCompleteL
       
  7962 // The phone book store initilization was complete
       
  7963 // (other items were commented in a header).
       
  7964 // ---------------------------------------------------------------------------
       
  7965 //    
       
  7966 void CMmPhoneTsy::PhoneBookStoreInitCompleteL(TInt aError)
       
  7967     {
       
  7968     TFLOGSTRING("TSY: CMmPhoneTsy::PhoneBookStoreInitCompleteL ");
       
  7969     TTsyReqHandle reqHandle = iTsyReqHandleStore->GetTsyReqHandle(
       
  7970         EMultimodePhoneGetMailboxNumbers );   
       
  7971     if( EMultimodePhoneReqHandleUnknown != reqHandle )
       
  7972         {
       
  7973         if( KErrNone != aError )
       
  7974             {
       
  7975             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetMailboxNumbers );
       
  7976             ReqCompleted(reqHandle, aError);
       
  7977             return;
       
  7978             }
       
  7979         CMmDataPackage mailBoxDataPackage;
       
  7980         mailBoxDataPackage.PackData( &iMailboxData );
       
  7981 
       
  7982         TInt ret = ( MessageManager()->HandleRequestL(
       
  7983                 EMobilePhoneGetMailboxNumbers, &mailBoxDataPackage ) );
       
  7984         if(ret != KErrNone)
       
  7985             {
       
  7986             iTsyReqHandleStore->ResetTsyReqHandle( EMultimodePhoneGetMailboxNumbers );
       
  7987             ReqCompleted(reqHandle, ret);
       
  7988             }
       
  7989         
       
  7990         }
       
  7991     if(GetONStoreTsy() != NULL)
       
  7992         {
       
  7993         GetONStoreTsy()->PhoneBookStoreInitCompleteL(aError);
       
  7994         }
       
  7995     }
       
  7996 
  7939 //  End of File
  7997 //  End of File
  7940 
  7998