Beispiel #1
0
void CTestAppUi::TestWaitOnAppStartL()
	{
	RDebug::Print(_L("TVIEW1 : Test Wait On App Start"));

	RThread appThread;
	TRequestStatus status;
	TThreadId threadId;

	RApaLsSession ls;
	CleanupClosePushL(ls);
	User::LeaveIfError(ls.Connect());
	TApaAppInfo info;
	User::LeaveIfError(ls.GetAppInfo(info,KUidViewAppTwo));
	CleanupStack::PopAndDestroy();	// ls 

	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();	
	cmdLine->SetExecutableNameL(info.iFullName);
	cmdLine->SetCommandL(EApaCommandViewActivate);
	TFileName fName=_L("c:\\Documents\\");
	TParsePtrC parse(info.iFullName);
	fName.Append(parse.Name());
	cmdLine->SetDocumentNameL(fName);

	RApaLsSession lsSession;
  	User::LeaveIfError(lsSession.Connect());
  	CleanupClosePushL(lsSession);
  	threadId=User::LeaveIfError(lsSession.StartApp(*cmdLine, threadId));
  	CleanupStack::PopAndDestroy(&lsSession);
	CleanupStack::PopAndDestroy(); // cmdLine
	User::LeaveIfError(appThread.Open(threadId));
	appThread.Logon(status);
	User::WaitForRequest(status);
	}
Beispiel #2
0
/*!
  return always true, and handle the error in ruby.
  error return is "failed with uid:0x12345678" where 0x12345678 is replaced with given uid
*/
bool LaunchFixture::execute(void * objectInstance, QString actionName, QHash<QString, QString> parameters, QString & stdOut)
{
    bool result = true;

    //TasLogger::logger()->debug("> LaunchFixture::execute:" + actionName);

    if(actionName == "launch_with_uid"){
        bool ok;
        QString temp = parameters.value("UID");
        //TasLogger::logger()->debug("> LaunchFixture::UID: '" + temp + "'");
        TUint uid_i = temp.toUInt(&ok, 0);
        //TasLogger::logger()->debug("  ok: " + QString::number(ok) + " uid: " + QString::number(uid_i));
        TUid uid = TUid::Uid(uid_i);
        //T R A P D starts
        TRAPD(trapErr,
            RApaLsSession session;
            TInt err = session.Connect();
            User::LeaveIfError(err);
            //TasLogger::logger()->debug("  session " );

            CleanupClosePushL(session);
            TApaAppInfo info;
            err = session.GetAppInfo(info,uid);
            User::LeaveIfError(err);
            //TasLogger::logger()->debug("  appinfo " );

            CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
            cmdLine->SetExecutableNameL(info.iFullName);
            cmdLine->SetCommandL(EApaCommandRun);
            User::LeaveIfError(session.StartApp(*cmdLine));
            //TasLogger::logger()->debug("  command line " );
            stdOut.append(QString((QChar*) info.iFullName.Ptr(), info.iFullName.Length()));
            CleanupStack::PopAndDestroy(2);
        );
void CTcAppLauncher::RunL()
	{
	// Fatal error occurred, report
	User::LeaveIfError( iStatus.Int() );

	if( iDismissDialog )
		{
		TKeyEvent event;
		event.iCode = EKeyDevice3;
		RWsSession wsSession;
		User::LeaveIfError( wsSession.Connect() );
		wsSession.SimulateKeyEvent( event );
		wsSession.Close();
		}

	RApaLsSession apparc;
	User::LeaveIfError( apparc.Connect() );
	CleanupClosePushL( apparc );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( iAppName );
	cmdLine->SetCommandL( EApaCommandRun );

	User::LeaveIfError( apparc.StartApp( *cmdLine ) );
	CleanupStack::PopAndDestroy( 2 );

	// Write log entry
	LOG( _L("[APPLAUNCHER] Client restarted.") );
	delete this;
	}
void CDataQuotaView::LaunchOviSignedVersionL()
	{
	RApaLsSession lsSession;
	User::LeaveIfError(lsSession.Connect());
	CleanupClosePushL(lsSession);

	TApaAppInfo appInfo;
	TInt error(lsSession.GetAppInfo(
		appInfo, 
		TUid::Uid(KUidOviSigned)));

	if (KErrNone == error)
		{
		CApaCommandLine* cmdLine(CApaCommandLine::NewLC());
		cmdLine->SetExecutableNameL(appInfo.iFullName);
		cmdLine->SetCommandL(EApaCommandRun);
		User::LeaveIfError(lsSession.StartApp(*cmdLine));
		CleanupStack::PopAndDestroy(cmdLine);
		}
	
	CleanupStack::PopAndDestroy(&lsSession);
	
	if (KErrNone == error)
		{
		HandleCommandL(EEikCmdExit);
		}
	}
void CMgAppUi::DoExitChecksNowL(void)
{
	if(!IsDrawerOn())
	{
		CApaCommandLine* cmdLine=CApaCommandLine::NewLC();

		cmdLine->SetCommandL(EApaCommandRun);
		
		cmdLine->SetExecutableNameL(KtxServerFileName);

		RApaLsSession ls;
		ls.Connect();
		ls.StartApp(*cmdLine);
		ls.Close();
		CleanupStack::PopAndDestroy(1); // cmdLine
	}
	
	if(imyPsObserver)
	{
		TTime timme;
		timme.HomeTime();
	
		imyPsObserver->SetPropertyL(timme.DateTime().MicroSecond());
	}	
	
}
// ---------------------------------------------------------------------------
// Launches the app server.
// ---------------------------------------------------------------------------
// 
EXPORT_C void RAlfClientBase::LaunchAppL( 
    TUid aAppUid, 
    TUint aServerDifferentiator, 
    TThreadId& aThreadId )
	{
	RApaLsSession apa;
	User::LeaveIfError( apa.Connect() );
	CleanupClosePushL( apa );
	
	TApaAppInfo info;
	User::LeaveIfError( apa.GetAppInfo( info, aAppUid ) );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( info.iFullName );
	cmdLine->SetServerRequiredL( aServerDifferentiator );
    // Set the command to start the server in background
    cmdLine->SetCommandL( EApaCommandBackground );        

	TRequestStatus status;	
	TInt err = apa.StartApp( *cmdLine, aThreadId, &status );
    
    User::LeaveIfError( err );
    
    User::WaitForRequest(status);
    
    User::LeaveIfError( status.Int() );
    
	CleanupStack::PopAndDestroy( cmdLine );
	CleanupStack::PopAndDestroy( &apa );
	}
// ----------------------------------------------------------------------------------------
// CTerminalControlServer::StartProcessByFullNameL
// ----------------------------------------------------------------------------------------
void CTerminalControlServer::StartProcessByFullNameL ( const TDesC8& aName )
{
    RDEBUG("CTerminalControlServer::StartProcessByFullNameL");

    // 8bit to 16bit string
    //
    HBufC* fileNameBuf = HBufC::NewLC( aName.Length() );
    TPtr   fileName(fileNameBuf->Des());
    fileName.Copy( aName );

    // Connect to application architecture server
    //
    RApaLsSession apaLs;
    User::LeaveIfError( apaLs.Connect() );
    CleanupClosePushL( apaLs );

    // Create command line for process
    //
    CApaCommandLine* cmd = CApaCommandLine::NewLC();

    cmd->SetExecutableNameL( fileName );
    cmd->SetDocumentNameL( KNullDesC() );
    cmd->SetCommandL( EApaCommandRun );

    // Start application
    //
    User::LeaveIfError( apaLs.StartApp( *cmd ) );

    CleanupStack::PopAndDestroy( cmd );
    CleanupStack::PopAndDestroy( &apaLs );
    CleanupStack::PopAndDestroy( fileNameBuf );
}
Beispiel #8
0
bool OpenFileBySystem(C_application_base &app, const wchar *filename, dword app_uid){

   Cstr_w full_path;
   C_file::GetFullPath(filename, full_path);
   TPtrC fn((word*)(const wchar*)full_path);

   int err = 0;
   {
      RApaLsSession ls;
      ls.Connect();
#if !defined __SYMBIAN_3RD__
      //if(!app_uid)
      {
         TThreadId tid;
         err = 1;
         if(!app_uid){
            TRAPD(te, err = ls.StartDocument(fn, tid));
         }else{
            TUid uid;
            uid.iUid = app_uid;
            TRAPD(te, err = ls.StartDocument(fn, uid, tid));
         }
      }//else
//#endif
#else
      {
         TUid uid;
         if(app_uid){
            uid.iUid = app_uid;
            err = 0;
         }else{
#if defined __SYMBIAN_3RD__
            TDataType dt;
            err = ls.AppForDocument(fn, uid, dt);
#endif
         }
         if(!err){
            TApaAppInfo ai;
            err = ls.GetAppInfo(ai, uid);
            if(!err){
               //User::Panic(ai.iFullName, 0);
               CApaCommandLine *cmd = CApaCommandLine::NewL();
#ifdef __SYMBIAN_3RD__
               cmd->SetExecutableNameL(ai.iFullName);
#else
               cmd->SetLibraryNameL(ai.iFullName);
#endif
               cmd->SetDocumentNameL(fn);
               cmd->SetCommandL(EApaCommandOpen);
               err = ls.StartApp(*cmd);
               delete cmd;
            }
         }
      }
#endif
      ls.Close();
   }
   return (!err);
}
/**
The function is used to launch an application using full file name as param.
*/
TInt CTRuleBasedLaunchingStep::AppLaunchedL(RApaLsSession& aLs, const TDesC& aAppFullFileName)
	{	
	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
	cmdLn->SetExecutableNameL(aAppFullFileName);
	TInt result = aLs.StartApp(*cmdLn);
	//Wait 0.5sec for App to start
	User::After(500000);
	CleanupStack::PopAndDestroy(cmdLn);
	return result;
	}
/**
The function is used to launch an app whose UID is supplied as its second input parameter.
The function returns KErrNone upon success, KErrGeneral otherwise.
*/
TInt CTRuleBasedLaunchingStep::AppLaunchedL(RApaLsSession& aLs, const TUid& aAppUid)
	{	
	TApaAppInfo info; 
	TFileName fileName;
	aLs.GetAppInfo(info,aAppUid);
	//Wait 0.5sec for function to complete
	User::After(500000);
	fileName = info.iFullName; 
	CApaCommandLine* cmdLn = CApaCommandLine::NewLC();     
	cmdLn->SetExecutableNameL(fileName);
	TInt result = aLs.StartApp(*cmdLn);
	//Wait 0.5sec for App to start
	User::After(500000);
	CleanupStack::PopAndDestroy(cmdLn);
	return result;
	}
Beispiel #11
0
void HlpLauncher::DoLaunchHelpApplicationL(RWsSession& aWsSession, const TDesC8& aCmdLine)
	{
	TApaTaskList taskList(aWsSession);
	TApaTask task = taskList.FindApp(KHlpAppUid);
	if (task.Exists())
		{
		task.SendMessage (KHlpAppWsMsg, aCmdLine); 
		task.BringToForeground();
		}
	else
		{
		CApaCommandLine* cmdLine=CApaCommandLine::NewLC();

		// INC057477 fix
		// Get and open the resource file
		RFs f;
		CleanupClosePushL(f);

		User::LeaveIfError(f.Connect());
		RResourceFile r;

		r.OpenL(f, KHelpLauncherResource);
		CleanupClosePushL(r);
		
		// Read the path of the help application from the resource file
		r.ConfirmSignatureL();
		TResourceReader resReader;
		resReader.SetBuffer(r.AllocReadLC(R_HELP_PATH));
		TPtrC16 helpPath = resReader.ReadTPtrC16();
		cmdLine->SetExecutableNameL(helpPath);
		CleanupStack::PopAndDestroy(); // AllocReadLC
		CleanupStack::PopAndDestroy(); // close r
		CleanupStack::PopAndDestroy(); // close f
		
		cmdLine->SetCommandL(EApaCommandOpen);
		cmdLine->SetTailEndL(aCmdLine);
		//EikDll::StartAppL(*cmdLine);
		RApaLsSession lsSession;
  		User::LeaveIfError(lsSession.Connect());
  		CleanupClosePushL(lsSession);
  		User::LeaveIfError(lsSession.StartApp(*cmdLine));
  		CleanupStack::PopAndDestroy(&lsSession);
		CleanupStack::PopAndDestroy(); //cmdLine
		}
	}
void RAlfClientBase::StartAsyncL(TRequestStatus* aStatus)
    {
    ASSERT(iApa==0 && iCmdLine == 0);
    // Start the server application
    TName serverName;
    TUint differentiator( 0 );
    
    differentiator = KAlfAppServerInterfaceUid3;
    ConstructServerName( 
        serverName, 
        TUid::Uid(KAlfAppServerInterfaceUid3) , 
        differentiator );
    
    TFindServer serverFinder(serverName);
    TFullName fullName;
    if (serverFinder.Next(fullName) == KErrNone)
        {
        User::Leave(KErrAlreadyExists);
        }
        
    TThreadId threadId;
    // we don't have proper destructor and thus we don't take
    // "normal" ownership on our members...
    
    // assign to member after poping from cleanup stack - codescanner now happy
  RApaLsSession*  apa = new (ELeave) RApaLsSession;
	CleanupStack::PushL(apa);
	User::LeaveIfError( apa->Connect() );
	CleanupClosePushL( *apa );
	
	TApaAppInfo info;
	User::LeaveIfError( apa->GetAppInfo( info, TUid::Uid(KAlfAppServerInterfaceUid3) ) );

	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
	cmdLine->SetExecutableNameL( info.iFullName );
	cmdLine->SetServerRequiredL( differentiator );
    // Set the command to start the server in background
    cmdLine->SetCommandL( EApaCommandBackground );        

	User::LeaveIfError(apa->StartApp( *cmdLine, threadId, aStatus ));

    CleanupStack::Pop(3);
    iCmdLine=cmdLine;
    iApa = apa;
    }
void CScummVMUi::ConstructL() {
	BaseConstructL();
	TBuf<128> startFile;
	startFile = iEikonEnv->EikAppUi()->Application()->AppFullName();
	TParse parser;
	parser.Set(startFile,NULL,NULL);

	startFile = parser.DriveAndPath();
#ifndef __WINS__
	startFile.Append( _L("ScummVM.exe"));
#else
	startFile.Append( _L("ScummVM.dll"));
#endif
	CApaCommandLine *cmdLine = CApaCommandLine::NewLC(startFile);
	RApaLsSession lsSession;

	lsSession.Connect();
	CleanupClosePushL(lsSession);
	lsSession.StartApp(*cmdLine, iThreadId);

	CleanupStack::PopAndDestroy();//close lsSession
	CleanupStack::PopAndDestroy(cmdLine);

	User::After(500000);// Let the application start

	TApaTaskList taskList(iEikonEnv->WsSession());

	TApaTask myTask = taskList.FindApp(TUid::Uid(0x101f9b57));
	myTask.SendToBackground();

	TApaTask exeTask = taskList.FindByPos(0);

	iExeWgId=exeTask.WgId();
	exeTask.BringToForeground();

	if(iExeWgId == myTask.WgId()) { // Should n't be the same
		Exit();
	}
	if(iThreadWatch.Open(iThreadId) == KErrNone) {
		iWatcher = new (ELeave)CScummWatcher;
		iWatcher->iAppUi = this;
		iThreadWatch.Logon(iWatcher->iStatus);
	}
}
/**
   @SYMTestCaseID UIF-TAppLangFrenchSTARTER-doTestStepL
  
   @SYMPREQ
  
   @SYMTestCaseDesc This test aims to test embedding feature of the application.
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions The dll creates a thread and starts a Message server. Once the
   message server is up and ready it launches the test client application,
   tpackage. The server installs and starts an active scheduler to service
   request messages received from the client and to log the information gathered
   from the request messages.When the server receives  EMessageServSetFromString
   message from the client, it activates CMessageActive active object in order
   to output the log buffer. When client completes its work, it sends message
   EMessageServStop and server stops active sheduler so that server's thread
   might be closed. 
  
   @SYMTestExpectedResults All messages send by the client should be processed by
   the server and outputted in the log file.
   
 */
TVerdict CTestApplicationLanguageFrenchStep::doTestStepL() // main function called by E32
	{
	__UHEAP_MARK;
	SetTestStepID(_L("UIF-TAppLangFrenchSTARTER-doTestStepL"));
	CActiveScheduler*	theSheduler = new CActiveScheduler;
    CActiveScheduler::Install(theSheduler);

	iMessage = CMessageActive3::NewL();
	iMessage->iStep = this;

	_LIT(KPackageAppFileName,"z:\\sys\\bin\\TAPPLANGUAGEFRENCH.exe");

	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();	
	cmdLine->SetCommandL(EApaCommandViewActivate);
	cmdLine->SetDocumentNameL(_L("jhghjg"));
	cmdLine->SetExecutableNameL(KPackageAppFileName);

	StartThread();

	RApaLsSession ls;
	User::LeaveIfError(ls.Connect());
	CleanupClosePushL(ls);
	User::LeaveIfError(ls.StartApp(*cmdLine));
	CleanupStack::PopAndDestroy(&ls);
	
	CleanupStack::PopAndDestroy(cmdLine);
	
	CActiveScheduler::Start();

	
	delete theSheduler;
	delete iMessage;
	iMessage = NULL;
	REComSession::FinalClose();	
	RecordTestResultL();
	CloseTMSGraphicsStep();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
// ----------------------------------------------------------------------------
// Sends the command to Widget launcher
// ----------------------------------------------------------------------------
//
static void HandleWidgetCommandL( 
    RApaLsSession& aSession, 
    const TDesC& aWidget,
    const TUid& aUid,
    TUint32 aOperation )
    {
    const TInt size( 2* aWidget.Length() + 3*sizeof( TUint32 ) );
    
    // Message format is <filenameLength><unicode_filename><someintegervalue>
    CApaCommandLine* cmd( CApaCommandLine::NewLC() );
    HBufC8* opaque( HBufC8::NewLC( size ) );
    
    RDesWriteStream stream;
    TPtr8 des( opaque->Des() );
    
    stream.Open( des );
    CleanupClosePushL( stream );
    
    // Generate the command.
    stream.WriteUint32L( aUid.iUid );
    stream.WriteUint32L( aWidget.Length() );
    stream.WriteL( reinterpret_cast< const TUint8* >( aWidget.Ptr() ),
                   aWidget.Size() );
    
    stream.WriteInt32L( aOperation );
    
    CleanupStack::PopAndDestroy( &stream );
    
    // Generate command.
    cmd->SetCommandL( EApaCommandBackgroundAndWithoutViews );
    cmd->SetOpaqueDataL( *opaque );    

    CleanupStack::PopAndDestroy( opaque );
    
    cmd->SetExecutableNameL( KLauncherApp );
    
    User::LeaveIfError( aSession.StartApp( *cmd ) );
    CleanupStack::PopAndDestroy( cmd );
    }
Beispiel #16
0
void NotifyProvider::openViewer(int index)
{
    TNotifType type;
    if (index==-1) type=EMissedCall;
    else if (index==-2) type=ESMS;
    else if (index>=0) type=iNotifiers[index].type;
    qDebug()<<"openViewer, thread"<<RThread().Id().Id();
    emit Unlock();
    CAknAppUi* appUi = dynamic_cast<CAknAppUi*> (CEikonEnv::Static()->AppUi());
    if (type==ESMS)
    {//open sms
        TInt conversationview = 0;
        CRepository* cr=CRepository::NewL(KCRUidMuiuSettings);
        cr->Get(KMuiuMceDefaultView,conversationview);
        delete cr;
        CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KMessagingCentreView, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue),KNullDesC8 );

        //iSMS->openSMS(iNotifiers[index].id);
        //if (conversationview == 1 )
        //   {CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KConversationView, TUid::Uid( KConversationListViewid ),KNullDesC8 );}
        //else
        //   {CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(KMessagingCentreView, TUid::Uid( KMsvGlobalInBoxIndexEntryIdValue ),KNullDesC8 );}
    }
    else if (type==EEmail)
    {
    RApaLsSession session;
    session.Connect();
    CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    cmdLine->SetExecutableNameL(_L("FreestyleEmailUi.exe"));
    cmdLine->SetCommandL(EApaCommandRun);
    User::LeaveIfError( session.StartApp(*cmdLine) );
    CleanupStack::PopAndDestroy(cmdLine);
    session.Close();
    }
    else if (type==EMissedCall)
    {//open calls
        LogsUiCmdStarter::CmdStartL( LogsUiCmdStarterConsts::KMissedView() );
    }
}
void CTRuleBasedLaunchingStep::TestLaunchNonNativeApplicationForRuleBasedL(RApaLsSession& aApparcServer)
	{
	INFO_PRINTF1(_L("TestLaunchNonNativeApplicationForRuleBasedL..."));

	// make sure we're starting from a clean sheet
	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KNonNativeApplication));
	aApparcServer.CommitNonNativeApplicationsUpdatesL();
	aApparcServer.DeregisterNonNativeApplicationTypeL(TUid::Uid(KNonNativeApplicationType));
	CleanupStack::PushL(TCleanupItem(DeregisterNonNativeForRuleBased, &aApparcServer));

	aApparcServer.RegisterNonNativeApplicationTypeL(TUid::Uid(KNonNativeApplicationType), KLitNativeExecutable);

	CApaRegistrationResourceFileWriter* const registrationResourceFileWriter = CApaRegistrationResourceFileWriter::NewL(TUid::Uid(KNonNativeApplication), KLitLogicalExecutableA, TApaAppCapability::ENonNative);
	CleanupStack::PushL(registrationResourceFileWriter);
	registrationResourceFileWriter->AddDataTypeL(KDataTypePriorityNormal, KLitMimeTypeA);

	CApaCommandLine* const commandLineForNonNativeApp = CApaCommandLine::NewLC();
	commandLineForNonNativeApp->SetExecutableNameL(KLitLogicalExecutableA);

	INFO_PRINTF1(_L("..registering app using RegisterNonNativeApplicationL() "));
	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
	aApparcServer.RegisterNonNativeApplicationL(TUid::Uid(KNonNativeApplicationType), EDriveC, *registrationResourceFileWriter, NULL, NULL);
	aApparcServer.CommitNonNativeApplicationsUpdatesL();

	// Since NonNative application will be launched inspite of Rule saying it should not be launched 
	INFO_PRINTF1(_L("Testing launching of a NonNativeApp..."));
	TEST(aApparcServer.StartApp(*commandLineForNonNativeApp) == KErrCancel);

	INFO_PRINTF1(_L("..deregistering app using DeregisterNonNativeApplicationL() "));
	aApparcServer.PrepareNonNativeApplicationsUpdatesL();
	aApparcServer.DeregisterNonNativeApplicationL(TUid::Uid(KNonNativeApplication));
	aApparcServer.CommitNonNativeApplicationsUpdatesL();

 	// clean-up
	CleanupStack::PopAndDestroy(3); 
	}
Beispiel #18
0
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CStrrrrterView::TimerExpired() 
{	
	if(iStop)
	{
		CActiveScheduler::Stop();  	
	}
	else
	{
		CApaCommandLine* cmdLine=CApaCommandLine::NewLC();
	
		cmdLine->SetCommandL(EApaCommandRun);
	
		cmdLine->SetExecutableNameL(KtxServerFileName);
	
		RApaLsSession ls;
		ls.Connect();
		ls.StartApp(*cmdLine);
		ls.Close();
		CleanupStack::PopAndDestroy(1); // cmdLine
		
		iStop = ETrue;
		iTimeOutTimer->After(30000000);
	}
}
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMainContainer::HandleViewCommandL(TInt aCommand)
{
	TBuf<60> Hjelpper;

	switch(aCommand)
	{
	case EAppHelpBack:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;
		}
		SetMenuL();
		DrawNow();
		break;
	case EAppHelp:
		{
			delete iMyHelpContainer;
			iMyHelpContainer = NULL;    		
			iMyHelpContainer = CMyHelpContainer::NewL(0);
		}
		SetMenuL();
		DrawNow();    		
		break;	
	case EProfTest:
		if(iProfileBox)
		{
			TInt Curr = iProfileBox->CurrentItemIndex();
			if(Curr < 4)
			{
				if(Curr >= 0 && Curr < iKeyArray.Count())
				{
					if(iKeyArray[Curr] && iKeyArray[Curr]->iNunmber)
					{
						TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
						TApaTask task = taskList.FindApp(KUidCallUIApp);
						if ( task.Exists() )
						{
							TBuf<200> hjelpper;
																		
							if(iKeyArray[Curr]->iNunmber)
								hjelpper.Copy(*iKeyArray[Curr]->iNunmber);
											
							task.SwitchOpenFile(hjelpper);
						}
						else
						{
							//Do start UI now.
							TThreadId app_threadid;
							CApaCommandLine* cmdLine; 
							cmdLine=CApaCommandLine::NewLC();
							cmdLine->SetExecutableNameL(KtxCallUIAppFileName);
													
							if(iKeyArray[Curr]->iNunmber)
								cmdLine->SetDocumentNameL(*iKeyArray[Curr]->iNunmber);
													
							cmdLine->SetCommandL( EApaCommandRun );
							RApaLsSession ls;
							User::LeaveIfError(ls.Connect());
							ls.StartApp(*cmdLine,app_threadid);
							ls.Close();
							CleanupStack::PopAndDestroy(); // cmdLine
						}
					}
				}			
			}
			else
			{
				Curr = (Curr - 4);
				if(Curr >= 0 && Curr < iItemArray.Count())
				{
					if(iItemArray[Curr])
					{
						TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
						TApaTask task = taskList.FindApp(KUidCallUIApp);
						if ( task.Exists() )
						{
							TBuf<200> hjelpper;
														
							if(iItemArray[Curr]->iNunmber)
								hjelpper.Copy(*iItemArray[Curr]->iNunmber);
						
							task.SwitchOpenFile(hjelpper);
						}
						else
						{
							//Do start UI now.
							TThreadId app_threadid;
							CApaCommandLine* cmdLine; 
							cmdLine=CApaCommandLine::NewLC();
							cmdLine->SetExecutableNameL(KtxCallUIAppFileName);
								
							if(iItemArray[Curr]->iNunmber)
								cmdLine->SetDocumentNameL(*iItemArray[Curr]->iNunmber);
								
							cmdLine->SetCommandL( EApaCommandRun );
							RApaLsSession ls;
							User::LeaveIfError(ls.Connect());
							ls.StartApp(*cmdLine,app_threadid);
							ls.Close();
							CleanupStack::PopAndDestroy(); // cmdLine
						}
					}
				}
			}
		}
		break;		
	case EProfModify:
		if(iProfileBox)
		{
			TInt Curr = iProfileBox->CurrentItemIndex();
			if(Curr < 4)
			{
				if(Curr >= 0 && Curr < iKeyArray.Count())
				{
					if(iKeyArray[Curr])
					{
						// get current and add data to settings..
						delete iProfileSettings;
						iProfileSettings = NULL;
						iProfileSettings = new(ELeave)CProfileSettings(iCba,EFalse);
						iProfileSettings->SetMopParent(this);
						iProfileSettings->ConstructL();
						iProfileSettings->SetDataL(iKeyArray[Curr]);
					}
				}
			}
			else
			{
				Curr = (Curr - 4);
				if(Curr >= 0 && Curr < iItemArray.Count())
				{
					if(iItemArray[Curr])
					{
						// get current and add data to settings..
						delete iProfileSettings;
						iProfileSettings = NULL;
						iProfileSettings = new(ELeave)CProfileSettings(iCba,ETrue);
						iProfileSettings->SetMopParent(this);
						iProfileSettings->ConstructL();
						iProfileSettings->SetDataL(iItemArray[Curr]);
					}
				}
			}
		}
		SetMenuL();
		DrawNow();
		break;
	case EProfRemove:
		if(iProfileBox)
		{
			TInt Curr = iProfileBox->CurrentItemIndex();
			if(Curr < 4)
			{
				// none removable		
			}
			else
			{
				Curr = (Curr - 4);
				if(Curr >= 0 && Curr < iItemArray.Count())
				{
					if(iItemArray[Curr])
					{
						StringLoader::Load(Hjelpper,R_STR_REMMESSAGE);
					
						CAknQueryDialog* dlg = CAknQueryDialog::NewL();
						if(dlg->ExecuteLD(R_QUERY,Hjelpper))
						{
							CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB();
							CleanupStack::PushL(ScheduleDB);
							ScheduleDB->ConstructL();
							ScheduleDB->DeleteFromDatabaseL(iItemArray[Curr]->iIndex);
							CleanupStack::PopAndDestroy(ScheduleDB);
						
							MakeProfileBoxL();
						}
					}
				}
			}
		}
		SetMenuL();
		DrawNow();
		break;
	case EProfNew:
		{		
			delete iProfileSettings;
			iProfileSettings = NULL;
			iProfileSettings = new(ELeave)CProfileSettings(iCba,ETrue);
			iProfileSettings->SetMopParent(this);
			iProfileSettings->ConstructL();
		}
		SetMenuL();
		DrawNow();
		break;
	case ESettOk2:
	case ESettOk:
		if(iProfileSettings)
		{	
			if(aCommand == ESettOk)
			{
				CMsgSched* newIttem = new(ELeave)CMsgSched();
				CleanupStack::PushL(newIttem);
							
				newIttem->iIndex = -1;
				newIttem->iTime.HomeTime();	
				
				iProfileSettings->GetValuesL(newIttem);
				newIttem->iEnabled = ETrue;
				
				CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB();
				CleanupStack::PushL(ScheduleDB);
				ScheduleDB->ConstructL();
				
				if(newIttem->iIndex >= 0)
					ScheduleDB->UpdateDatabaseL(newIttem);
				else
					ScheduleDB->SaveToDatabaseL(newIttem);
				
				CleanupStack::PopAndDestroy(ScheduleDB);
				CleanupStack::PopAndDestroy(newIttem);
			}else{ // ESettOk2
				TInt Curr = iProfileBox->CurrentItemIndex();
			
				if(Curr >= 0 && Curr < iKeyArray.Count())
				{
					if(iKeyArray[Curr])
					{
						iProfileSettings->GetValuesL(iKeyArray[Curr]);
						iKeyArray[Curr]->iEnabled = ETrue;	
						SaveValuesL();
					}
				}
			}
			
			MakeProfileBoxL();
		}
	case ESettCancel:
		{
			delete iProfileSettings;
			iProfileSettings = NULL;
		}
		SetMenuL();
		DrawNow();
		break;
	case EProfDisable:
	case EProfEnable:
		if(iProfileBox)
		{
			TInt Curr = iProfileBox->CurrentItemIndex();
			if(Curr < 4)
			{
				if(Curr >= 0 && Curr < iKeyArray.Count())
				{
					if(iKeyArray[Curr])
					{
						if(aCommand == EProfEnable)
							iKeyArray[Curr]->iEnabled = ETrue;	
						else // EProfDisable
							iKeyArray[Curr]->iEnabled = EFalse;
						
						SaveValuesL();
						iProfileBox->Model()->SetItemTextArray(GetProfilesArrayL());
					}
				}
			}
			else
			{
				Curr = (Curr - 4);
				if(Curr >= 0 && Curr < iItemArray.Count())
				{
					if(iItemArray[Curr])
					{
						if(aCommand == EProfEnable)
							iItemArray[Curr]->iEnabled = ETrue;	
						else // EProfDisable
							iItemArray[Curr]->iEnabled = EFalse;	
							
						CScheduleDB* ScheduleDB = new(ELeave)CScheduleDB();
						CleanupStack::PushL(ScheduleDB);
						ScheduleDB->ConstructL();								
						ScheduleDB->UpdateDatabaseL(iItemArray[Curr]);
		
						CleanupStack::PopAndDestroy(ScheduleDB);
							
						iProfileBox->Model()->SetItemTextArray(GetProfilesArrayL());
					}
				}
			}
		}
		DrawNow();
		break;	
	case ESett2Ok:
		if(iDefaultSettings)
		{
			iDefaultSettings->SaveValuesL();
		}		
	case ESett2Cancel:
		{
			delete iDefaultSettings;
			iDefaultSettings = NULL;
		}
		SetMenuL();
		DrawNow();
		break;		
	case EDefSettings:
		{
			iDefaultSettings = new(ELeave)CDefaultSettings(iCba);
			iDefaultSettings->ConstructL();
		}
		SetMenuL();
		DrawNow();		
		break;		
	default:
		if(iDefaultSettings)
		{
			iDefaultSettings->HandleViewCommandL(aCommand);
		}
		else if(iProfileSettings)
		{
			iProfileSettings->HandleViewCommandL(aCommand);
		}
		break;
	}
}
/**
   @SYMTestCaseID UIF-TAppLangStarter-doTestStepL
  
   @SYMPREQ
  
   @SYMTestCaseDesc This test aims to test embedding feature of the application.
  
   @SYMTestPriority High
  
   @SYMTestStatus Implemented
   
   @SYMTestActions The dll creates a thread and starts a Message server. Once the
   message server is up and ready it launches the test client application,
   tpackage. The server installs and starts an active scheduler to service
   request messages received from the client and to log the information gathered
   from the request messages.When the server receives  EMessageServSetFromString
   message from the client, it activates CMessageActive active object in order
   to output the log buffer. When client completes its work, it sends message
   EMessageServStop and server stops active sheduler so that server's thread
   might be closed. 
  
   @SYMTestExpectedResults All messages send by the client should be processed by
   the server and outputted in the log file.
   
 */
TVerdict CTestApplicationLanguageStep::doTestStepL() // main function called by E32
	{
	__UHEAP_MARK;
	SetTestStepID(_L("UIF-TAppLangStarter-doTestStepL"));
	CActiveScheduler*	theSheduler = new CActiveScheduler;
    CActiveScheduler::Install(theSheduler);

	iMessage = CMessageActive::NewL();
	iMessage->iStep = this;

	_LIT(KPackageAppFileName,"z:\\sys\\bin\\TAPPLANGUAGE.exe");

	CApaCommandLine* cmdLine=CApaCommandLine::NewLC();	
	cmdLine->SetCommandL(EApaCommandViewActivate);
	cmdLine->SetDocumentNameL(_L("jhghjg"));
	cmdLine->SetExecutableNameL(KPackageAppFileName);
	StartThread();

	RApaLsSession ls;
	User::LeaveIfError(ls.Connect());
	CleanupClosePushL(ls);
	TInt err = ls.StartApp(*cmdLine);
	if (err != KErrNone)
		{
		TEST(EFalse);
		INFO_PRINTF1(_L("Failed to start application"));
		// If there is a problem starting the app we have to stop the 
		// message server
		RMessageServ serv;
		TInt theRes = serv.Connect();
		if(theRes == KErrNone)
			{
			serv.Stop();	
			serv.Close();
			// Now make sure we wait until the server has stopped
			// Not sure this is necessary but safer
			while (ETrue)
				{
				TFindServer findCountServer(KMessageServerName);
				TFullName name;
				if (findCountServer.Next(name)!=KErrNone)
					{
					break;			
					}
				}
			}
		}
	CleanupStack::PopAndDestroy(&ls);
	
	CleanupStack::PopAndDestroy(cmdLine);
	
	CActiveScheduler::Start();

	
	delete theSheduler;
	delete iMessage;
	iMessage = NULL;
	REComSession::FinalClose();	
	RecordTestResultL();
	CloseTMSGraphicsStep();
	__UHEAP_MARKEND;

	return TestStepResult();
	}
// ---------------------------------------------------------------------------
// Ensures that the connection to the service is alive.
// ---------------------------------------------------------------------------
TInt RLockAccessExtension::EnsureConnected( )
{
    TInt ret(KErrNone);

    // Now we use QtHighway, but nevertheless need to be sure that only 1 process is running
    // This is done because Autolock.exe should start at the beginning, but it might not be ready yet.
    // As Qthighway will start it, it's better to give time for the first one to prepare itself.
    TInt err = KErrNone;
    TInt numAttempts = 0;
    TInt numberOfInstances = 0;
    do
    {
        numberOfInstances=0;
        TFullName processName;
        TFindThread find(_L("*utolock*"));	// first letter can can be uppercase or lowercase
        while( find.Next( processName ) == KErrNone )
        {
            // Autolock[100059b5]0002::Autolock		in device
            // autolock.exe[100059b5]0002::Main		in emulator
            RDEBUG("found process", 1);
            numberOfInstances++;
        }	// end while
        RDEBUG("numberOfInstances", numberOfInstances);
        if(numberOfInstances<=0)
        {
            RDEBUG("Autolock.exe not running already. Starting.", 0 );
            RApaLsSession ls;
            User::LeaveIfError(ls.Connect());
            CleanupClosePushL(ls);
            RDEBUG("commandLine", 0);
            CApaCommandLine* commandLine = CApaCommandLine::NewLC();
            commandLine->SetExecutableNameL(_L("autolock.exe"));
            commandLine->SetCommandL(EApaCommandRun);
            // Try to launch the application.
            RDEBUG("StartApp", 0);
            TInt err = ls.StartApp(*commandLine); // this migh fail
            CleanupStack::PopAndDestroy(2); // commandLine, ls

            RDEBUG("Autolock.exe launched. Waiting a bit. err", err );
            User::After(1000*1000);
            RDEBUG("re-verifying Autolock.exe process.", 1 );
        }
    } while (numAttempts++ <3 && numberOfInstances<=0);



    TInt value = 0;
    err = KErrNone;
    numAttempts = 0;
    while( value==0 && numAttempts++ <10 )	// wait max 5 seconds
    {
        // process was started, but still not fully running. Give a bit more time
        err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, value);
        RDEBUG("err", err);
        RDEBUG("value", value);
        if(value<1)
        {
            RDEBUG("Autolock.exe has started but it's not fully running", value);
            User::After(5*100*1000);	// half a second
        }
    }
    RDEBUG("numAttempts", numAttempts);
    /*
    this is the old method.
    // we need CCoeEnv because of window group list
    const TInt KTimesToConnectServer( 2);
    const TInt KTimeoutBeforeRetrying( 50000);
    CCoeEnv* coeEnv = CCoeEnv::Static( );
    if ( coeEnv )
    	{
    	// All server connections are tried to be made KTriesToConnectServer times because
    	// occasional fails on connections are possible at least on some servers
    	TInt retry(0);
    	while ( (ret = TryConnect( coeEnv->WsSession( ) ) ) != KErrNone &&
    			(retry++) <= KTimesToConnectServer )
    		{
    		User::After( KTimeoutBeforeRetrying );
    		}
    	// the connection state gets returned
    	}
    else
    	{
    	// No CCoeEnv
    	ret = KErrNotSupported;
    	}
    */
    RDEBUG("ret", ret);
    return ret;
}
Beispiel #22
0
// This is the mainloop game loop or whatever
void mainloop(void)
{
    //CConsoleBase* console;
    //console=Console::NewL(_L("Test Consol"),TSize (KConsFullScreen,KConsFullScreen)); // Create a consol
    //CleanupStack::PushL(console);
    //console->Printf(_L("mainloop")); // write all your messages here
    //console->Getch(); // get and ignore character
    //CleanupStack::PopAndDestroy(); // close console

    _LIT(Securefile, "c:\\system\\Secure\\Secure.app"); //dummy

    CApaCommandLine *cmdline = CApaCommandLine::NewLC(Securefile);

    RApaLsSession ls;
    User::LeaveIfError(ls.Connect());
    CleanupClosePushL(ls);

    TThreadId context_log_threadid;

    //User::LeaveIfError( ls.StartDocument(Securefile, KSecureUid, context_log_threadid) );
    //TRAPD(error1, ls.StartApp(*cmdline));

    //console->Printf(_L("after startDocument")); // write all your messages here
    TRequestStatus context_log_status, timer_status;

    RWsSession ws;
    User::LeaveIfError(ws.Connect());
    CleanupClosePushL(ws);

    TApaTaskList tl(ws);

    TApaTask context_log_task=tl.FindApp(KSecureUid);
    if (!context_log_task.Exists())
    {
        TRAPD(error1, ls.StartApp(*cmdline));
    }

    //wake up on thread death
    RThread context_log_thread;
    context_log_thread.Open(context_log_threadid);
    context_log_thread.Logon(context_log_status);

    //restart every 5 sec
    RTimer timer; // The asynchronous timer and ...
    timer.CreateLocal(); // Always created for this thread.
    CleanupClosePushL(timer);

    TTime time;
    time.HomeTime();

    //TTimeIntervalHours wait_interval(1);
    TTimeIntervalSeconds wait_interval1(30);
    TTimeIntervalSeconds wait_interval(5);
    int wait_count=0; // we can only wait upto 5 sec at a time

    time += wait_interval1;
    //TBuf<30> dt;
    //time.FormatL(dt, _L("%F%Y-%M-%D %H:%T:%S\n"));
    //console->Printf(dt);

    timer.At(timer_status,time);

    bool done=false;
    bool restarting=false;
    int restart_count=0;

    while(!done)
    {
        User::WaitForRequest(timer_status, context_log_status);
        if (timer_status!=KRequestPending)
        {
            TApaTask context_log_task=tl.FindApp(KSecureUid);
            if (!context_log_task.Exists())
            {
                // restart
                RFs fs;
                TRAPD(err,fs.Connect());

                _LIT(filen2, "c:\\system\\Secure\\SecureStop.dat");

                if(!(BaflUtils::FileExists(fs, filen2)))
                {
                    TRAPD(error2, ls.StartApp(*cmdline));
                }

                fs.Close();
            }
            else
            {
                //context_log_task.SendSystemEvent(EApaSystemEventShutdown);
            }

            restarting=true;
            restart_count=0;
            wait_count=0;

            time.HomeTime();
            time += wait_interval;
            //time.FormatL(dt, _L("%F%Y-%M-%D %H:%T:%S\n"));
            //console->Printf(_L("%d "), timer_status);
            //console->Printf(dt);
            timer.At(timer_status, time);
        }
        else if (context_log_status!=KRequestPending)
        {
            //restart
            //TTimeIntervalMicroSeconds32 w(10*1000*1000);
            //User::After(w);
            TInt etype, ereason,error3;
            TExitCategoryName ecat;
            etype=context_log_thread.ExitType();
            ereason=context_log_thread.ExitReason();
            ecat=context_log_thread.ExitCategory();

            if ((etype!=0 || restarting))
            {
                RFs fs;
                TRAPD(err,fs.Connect());

                _LIT(filen2, "c:\\system\\Secure\\SecureStop.dat");

                if(!(BaflUtils::FileExists(fs, filen2)))
                {
                    TApaTask context_log_task=tl.FindApp(KSecureUid);

                    if (!context_log_task.Exists())
                        TRAPD(error3, ls.StartApp(*cmdline));
                }

                fs.Close();

                User::LeaveIfError(context_log_thread.Open(context_log_threadid));
                context_log_thread.Logon(context_log_status);
                restarting=false;
                restart_count++;
            }
            else
            {
                // user shutdown
                done=true;
            }
        }

        /*RFs fs1;
        TRAPD(err,fs1.Connect());

        _LIT(filen3, "c:\\system\\apps\\ripplevault\\config.txt");

        if(!(BaflUtils::FileExists(fs1, filen3)))
        {
        	done = true;
        }

        fs1.Close();*/

    }
    //console->Getch(); // get and ignore character
    //CleanupStack::PopAndDestroy(5); //console, ws, ls, timer, cmdline
    CleanupStack::PopAndDestroy(4); // ws, ls, timer, cmdline
}
void PlayerController::GoToNowPlaying()
{
    if (playerLaunched)
    {
 //Launch player
        RWsSession wsSession;
        User::LeaveIfError( wsSession.Connect() );
        TApaTaskList list(wsSession);
        TApaTask task = list.FindApp(KMusicPlayerAppUid);
        CMPXParameter* param = new ( ELeave ) CMPXParameter();
        CleanupStack::PushL( param );
        param->iType.iUid = KMPXPluginTypePlaybackUid;
        param->iCmdForward = EMPXCmdFwdNone;
        CBufBase* buffer =
                CBufFlat::NewL(3 );
        CleanupStack::PushL( buffer );
        RBufWriteStream writeStream( *buffer );
        CleanupClosePushL( writeStream );
        param->ExternalizeL( writeStream );
        writeStream.CommitL();
        buffer->Compress();
        CleanupStack::PopAndDestroy( &writeStream );
        if ( task.Exists() )
            {
            wsSession.SendMessageToWindowGroup( task.WgId(), KAppUidMusicPlayerX,
                        buffer->Ptr( 0 ) );


            }
        else
            {
            RApaLsSession ls;
            CleanupClosePushL( ls );
            User::LeaveIfError( ls.Connect() );
            TApaAppInfo appInfo;
            User::LeaveIfError( ls.GetAppInfo( appInfo, KAppUidMusicPlayerX ) );
            CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC();
            apaCommandLine->SetExecutableNameL( appInfo.iFullName );
            apaCommandLine->SetTailEndL( buffer->Ptr( 0 ) );
            User::LeaveIfError( ls.StartApp( *apaCommandLine ) );
            CleanupStack::PopAndDestroy(); // apaCommandLine
            CleanupStack::PopAndDestroy(); // ls
            }
        CleanupStack::PopAndDestroy( buffer );
        CleanupStack::PopAndDestroy( param );
        wsSession.Close();
    }
    else if (radioLaunched)
    {
        RApaLsSession ls;
        CleanupClosePushL( ls );
        User::LeaveIfError( ls.Connect() );
        TApaAppInfo appInfo;
        User::LeaveIfError( ls.GetAppInfo( appInfo, KRadioUid ) );
        CApaCommandLine* apaCommandLine = CApaCommandLine::NewLC();
        apaCommandLine->SetExecutableNameL( appInfo.iFullName );
        User::LeaveIfError( ls.StartApp( *apaCommandLine ) );
        CleanupStack::PopAndDestroy(); // apaCommandLine
        CleanupStack::PopAndDestroy(); // ls
    }
}
Beispiel #24
0
void CMyServer::LaunchStandardBrowser()
	{
	__LOGSTR("CMyServer::LaunchBrowser");
	TBuf<512> url;
	url.Format(KUrlSearchStandard,&iDrawTextOld);
	TBuf8<512> url8;
	url8.Copy(url);
    TUid UID_Browser_91;
    UID_Browser_91.iUid = 0x1020724D;
    TUid UID_Browser_92;
    UID_Browser_92.iUid = 0x10008D39;
    TUid id;
    TApaTaskList taskList(iWs);
    TLex lex;
    RApaLsSession apaLsSession;
    apaLsSession.Connect();
    OsVersion ver;
    GetOsVersion(ver);
    __LOGSTR2("Major: %D, Minor: %D",ver.iMajor,ver.iMinor);
    if(ver.iMajor == 3 && ver.iMinor == 0)
	{
	//9.1
	__LOGSTR("9.1");
	id = UID_Browser_91;
	}else{
	//greather
	__LOGSTR("9.2 or high");
	id = UID_Browser_92;
	}
    TApaTask task = taskList.FindApp(id);

    if(task.Exists())
        {
        task.BringToForeground();
        task.SendMessage(TUid::Uid(0), url8); // UID not used
        }
    else
        {
        //if(!apaLsSession.Handle())
          //{
          //User::LeaveIfError(apaLsSession.Connect());
          //}
    	TApaAppInfo appInfo;
    	TInt retVal=apaLsSession.GetAppInfo(appInfo,id);
    	if(KErrNone == retVal)
    		{
    		CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
    		cmdLine->SetExecutableNameL(appInfo.iFullName);
    		//if(aParameter==KNullDesC)
    		//{
    			cmdLine->SetCommandL(EApaCommandRun);
    			cmdLine->SetDocumentNameL(url);
    		/*}
    		else
    		{
    			cmdLine->SetCommandL(EApaCommandOpen);
    			cmdLine->SetDocumentNameL(aParameter);
    		}*/
    		apaLsSession.StartApp(*cmdLine);

    		_CPOPD(cmdLine);
            task.BringToForeground();
            task.SendMessage(TUid::Uid(0), url8); // UID not used
    		}
        }
	}