securitydialogs/Autolock/src/main.cpp
changeset 61 1cc4c46c2963
parent 45 5d3e34b7618a
equal deleted inserted replaced
56:25a3fbb5e4d3 61:1cc4c46c2963
    26 #include "Autolock.h"
    26 #include "Autolock.h"
    27 #include "../PubSub/securityuisprivatepskeys.h"
    27 #include "../PubSub/securityuisprivatepskeys.h"
    28 
    28 
    29 #include <hbapplication.h>
    29 #include <hbapplication.h>
    30 #include <hbmainwindow.h>
    30 #include <hbmainwindow.h>
       
    31 #include <apgwgnam.h>
       
    32 #include <eikenv.h>
    31 
    33 
    32 int main(int argc, char **argv)
    34 int main(int argc, char **argv)
    33 {
    35 {
    34     // qInstallMsgHandler(XQSERVICEMESSAGEHANDLER);
    36     // qInstallMsgHandler(XQSERVICEMESSAGEHANDLER);
    35     // XQSERVICE_DEBUG_PRINT(" ================== xxxx Autolock::main");
    37     // XQSERVICE_DEBUG_PRINT(" ================== xxxx Autolock::main");
    50 		qDebug() << "KSecurityUIsLockInitiatorUID myInitiatorUID=" << myInitiatorUID;
    52 		qDebug() << "KSecurityUIsLockInitiatorUID myInitiatorUID=" << myInitiatorUID;
    51 		err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, 0);
    53 		err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorUID, 0);
    52 
    54 
    53     // it takes about 3 seconds to start it, on device
    55     // it takes about 3 seconds to start it, on device
    54     QApplication a( argc, argv );
    56     QApplication a( argc, argv );
       
    57     // hide server from TaskSwitcher
       
    58     CEikonEnv * env = CEikonEnv::Static();
       
    59     if(env) {
       
    60         env->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront);
       
    61 
       
    62         CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(env->WsSession());    
       
    63         wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
       
    64         wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down    
       
    65         // wgName->SetCaptionL(KRunningAppServerName);
       
    66         wgName->SetWindowGroupName(env->RootWin());
       
    67         CleanupStack::PopAndDestroy(wgName);
       
    68     }
       
    69 
    55     Autolock *cl = new Autolock();
    70     Autolock *cl = new Autolock();
    56     // qDebug() << " Autolock::main cl->show";
    71     // qDebug() << " Autolock::main cl->show";
    57     // cl->show();
    72     // cl->show();
    58     // qDebug() << " Autolock::main cl->hide";
    73     // qDebug() << " Autolock::main cl->hide";
    59     cl->hide();
    74     cl->hide();