appinstaller/AppinstUi/sisxsifplugin/src/sisxsifpluginactiveimpl.cpp
changeset 58 67f2119dc623
parent 55 ac7f90a6ff4c
child 69 b18a4bf55ddb
equal deleted inserted replaced
57:0dae4436159f 58:67f2119dc623
   349 
   349 
   350     // Uninstall is always silent. TrustedUI capability is required.
   350     // Uninstall is always silent. TrustedUI capability is required.
   351 	if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) )
   351 	if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) )
   352 		{
   352 		{
   353 		FLOG( _L( "CSisxSifPluginActiveImpl::Uninstall, missing ECapabilityTrustedUI") );
   353 		FLOG( _L( "CSisxSifPluginActiveImpl::Uninstall, missing ECapabilityTrustedUI") );
   354 		iErrorHandler->SetExtendedErrorCode( ETrustedUICapabilityRequired );
   354 		iErrorHandler->SetExtendedErrorCode( ESifUiTrustedUICapabilityRequired );
   355 		CompleteClientRequest( KErrPermissionDenied );
   355 		CompleteClientRequest( KErrPermissionDenied );
   356 		return;
   356 		return;
   357 		}
   357 		}
   358 
   358 
   359 	TRAPD( error, DoUninstallL( aComponentId, aInputParams, aOutputParams, aStatus ) );
   359 	TRAPD( error, DoUninstallL( aComponentId, aInputParams, aOutputParams, aStatus ) );
   592     if( IsSilentMode() )
   592     if( IsSilentMode() )
   593         {
   593         {
   594         if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) )
   594         if( !aSecurityContext.HasCapability( ECapabilityTrustedUI ) )
   595             {
   595             {
   596             FLOG( _L("CSisxSifPluginActiveImpl::Install, missing ECapabilityTrustedUI") );
   596             FLOG( _L("CSisxSifPluginActiveImpl::Install, missing ECapabilityTrustedUI") );
   597             iErrorHandler->SetExtendedErrorCode( ETrustedUICapabilityRequired );
   597             iErrorHandler->SetExtendedErrorCode( ESifUiTrustedUICapabilityRequired );
   598             CompleteClientRequest( KErrPermissionDenied );
   598             CompleteClientRequest( KErrPermissionDenied );
   599             return;
   599             return;
   600             }
   600             }
   601         }
   601         }
   602 
   602 
   637     TUid uid;
   637     TUid uid;
   638     CComponentEntry *entry = CComponentEntry::NewLC();
   638     CComponentEntry *entry = CComponentEntry::NewLC();
   639     GetComponentAndUidL( aComponentId, *entry, uid );
   639     GetComponentAndUidL( aComponentId, *entry, uid );
   640     iUiHandler->PublishStartL( *entry );
   640     iUiHandler->PublishStartL( *entry );
   641     CleanupStack::PopAndDestroy( entry );
   641     CleanupStack::PopAndDestroy( entry );
   642     
   642 
   643     iAsyncLauncher->UninstallL( *iUiHandler, uid, iStatus );
   643     iAsyncLauncher->UninstallL( *iUiHandler, uid, iStatus );
   644 
   644 
   645     iOperation = EUninstall;
   645     iOperation = EUninstall;
   646     iPhase = ERunningOperation;
   646     iPhase = ERunningOperation;
   647     SetActive();
   647     SetActive();
   703     if( iOutputParams )
   703     if( iOutputParams )
   704         {
   704         {
   705         iErrorHandler->FillOutputParamsL( *iOutputParams );
   705         iErrorHandler->FillOutputParamsL( *iOutputParams );
   706         }
   706         }
   707     iUiHandler->PublishCompletionL();
   707     iUiHandler->PublishCompletionL();
   708     
   708 
   709     if( aError != KErrNone && aError != KErrCancel )
   709     if( aError != KErrNone && aError != KErrCancel )
   710         {
   710         {
   711         iUiHandler->DisplayFailedL( *iErrorHandler );
   711         iUiHandler->DisplayFailedL( *iErrorHandler );
   712         }
   712         }
   713     }
   713     }
   770 //
   770 //
   771 void CSisxSifPluginActiveImpl::GetComponentAndUidL( TComponentId aComponentId,
   771 void CSisxSifPluginActiveImpl::GetComponentAndUidL( TComponentId aComponentId,
   772         CComponentEntry& aEntry, TUid& aUid ) const
   772         CComponentEntry& aEntry, TUid& aUid ) const
   773     {
   773     {
   774     FLOG_1( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, component %d"), aComponentId );
   774     FLOG_1( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, component %d"), aComponentId );
   775     
   775 
   776     RSoftwareComponentRegistry scrSession;
   776     RSoftwareComponentRegistry scrSession;
   777     User::LeaveIfError( scrSession.Connect() );
   777     User::LeaveIfError( scrSession.Connect() );
   778     CleanupClosePushL( scrSession );
   778     CleanupClosePushL( scrSession );
   779 
   779 
   780     if( scrSession.GetComponentL( aComponentId, aEntry ) )
   780     if( scrSession.GetComponentL( aComponentId, aEntry ) )
   781         {
   781         {
   782         FLOG( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, entry found") );
   782         FLOG( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, entry found") );
   783         
   783 
   784         CPropertyEntry* propertyEntry = scrSession.GetComponentPropertyL( aComponentId, KCompUid );
   784         CPropertyEntry* propertyEntry = scrSession.GetComponentPropertyL( aComponentId, KCompUid );
   785         CleanupStack::PushL( propertyEntry );
   785         CleanupStack::PushL( propertyEntry );
   786         
   786 
   787         CIntPropertyEntry* intPropertyEntry = dynamic_cast< CIntPropertyEntry* >( propertyEntry );
   787         CIntPropertyEntry* intPropertyEntry = dynamic_cast< CIntPropertyEntry* >( propertyEntry );
   788         if( !intPropertyEntry )
   788         if( !intPropertyEntry )
   789             {
   789             {
   790             FLOG( _L("CSisxSifPluginActiveImpl::GetComponentUidL, UID property not found") );
   790             FLOG( _L("CSisxSifPluginActiveImpl::GetComponentUidL, UID property not found") );
   791             User::Leave( KErrNotFound );
   791             User::Leave( KErrNotFound );
   792             }
   792             }
   793         aUid = TUid::Uid( intPropertyEntry->IntValue() );
   793         aUid = TUid::Uid( intPropertyEntry->IntValue() );
   794         
   794 
   795         CleanupStack::PopAndDestroy( propertyEntry );
   795         CleanupStack::PopAndDestroy( propertyEntry );
   796         }
   796         }
   797     else
   797     else
   798         {
   798         {
   799         FLOG( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, entry not found") );
   799         FLOG( _L("CSisxSifPluginActiveImpl::GetComponentAndUidL, entry not found") );
  1021 // ---------------------------------------------------------------------------
  1021 // ---------------------------------------------------------------------------
  1022 //
  1022 //
  1023 void CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL()
  1023 void CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL()
  1024     {
  1024     {
  1025     FLOG( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL, begin") );
  1025     FLOG( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL, begin") );
  1026     
  1026 
  1027     CArrayFixFlat<TInt>* installedLanguages = NULL;
  1027     CArrayFixFlat<TInt>* installedLanguages = NULL;
  1028     TInt err = SysLangUtil::GetInstalledLanguages( installedLanguages, &iFs );
  1028     TInt err = SysLangUtil::GetInstalledLanguages( installedLanguages, &iFs );
  1029     CleanupStack::PushL( installedLanguages );
  1029     CleanupStack::PushL( installedLanguages );
  1030     User::LeaveIfError( err );
  1030     User::LeaveIfError( err );
  1031     if( installedLanguages )
  1031     if( installedLanguages )
  1037             FLOG_1( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL: %d"), language );
  1037             FLOG_1( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL: %d"), language );
  1038             iDeviceSupportedLanguages.AppendL( language );
  1038             iDeviceSupportedLanguages.AppendL( language );
  1039             }
  1039             }
  1040         }
  1040         }
  1041     CleanupStack::PopAndDestroy( installedLanguages );
  1041     CleanupStack::PopAndDestroy( installedLanguages );
  1042     
  1042 
  1043     FLOG( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL, end") );
  1043     FLOG( _L("CSisxSifPluginActiveImpl::FillDeviceSupportedLanguagesL, end") );
  1044     }
  1044     }
  1045 
  1045