uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp
branchRCL_3
changeset 3 d8a3531bc6b8
parent 0 15bf7259bb7c
child 11 46927d61fef3
equal deleted inserted replaced
0:15bf7259bb7c 3:d8a3531bc6b8
    54 KGOomErrBadOrMissingUidInAppConfig,
    54 KGOomErrBadOrMissingUidInAppConfig,
    55 KGOomErrBadOrMissingPriorityInAppCloseConfig,
    55 KGOomErrBadOrMissingPriorityInAppCloseConfig,
    56 KGOomErrBadLowThresholdValueForAppConfig,
    56 KGOomErrBadLowThresholdValueForAppConfig,
    57 KGOomErrBadGoodThresholdValueForAppConfig,
    57 KGOomErrBadGoodThresholdValueForAppConfig,
    58 KGOomErrBadTargetFreeValueForAppConfig,
    58 KGOomErrBadTargetFreeValueForAppConfig,
       
    59 KGOomErrBadSkipPluginValueForAppConfig,
    59 KGOomErrSystemPluginSettingsMustComeAfterAppCloseSettings,
    60 KGOomErrSystemPluginSettingsMustComeAfterAppCloseSettings,
    60 KGOomErrAppPluginSettingsMustComeAfterSystemPluginSettings,
    61 KGOomErrAppPluginSettingsMustComeAfterSystemPluginSettings,
    61 KGOomErrAppPluginIdleTimeRulesMustComeAfterAppPluginSettings,
    62 KGOomErrAppPluginIdleTimeRulesMustComeAfterAppPluginSettings,
    62 KGOomErrBadOrMissingUidInAppCloseConfig,
    63 KGOomErrBadOrMissingUidInAppCloseConfig,
    63 KGOomErrBadOrMissingUidInSystemPluginConfig,
    64 KGOomErrBadOrMissingUidInSystemPluginConfig,
   107 
   108 
   108 // App close settings
   109 // App close settings
   109 _LIT8(KGOomConfigAppCloseSettings, "app_close_settings");
   110 _LIT8(KGOomConfigAppCloseSettings, "app_close_settings");
   110 _LIT8(KGOomConfigCloseApp, "close_app");
   111 _LIT8(KGOomConfigCloseApp, "close_app");
   111 
   112 
       
   113 _LIT8(KGOomAttributeAppCloseTimeout, "close_timeout");
       
   114 _LIT8(KGOomAttributeAppWaitAfterClose, "wait_after_close");
       
   115 
   112 // App close idle time
   116 // App close idle time
   113 _LIT8(KGOomConfigAppCloseIdlePriority, "app_close_idle_priority");
   117 _LIT8(KGOomConfigAppCloseIdlePriority, "app_close_idle_priority");
   114 
   118 
   115 _LIT8(KGOomConfigForegroundAppPriority, "foreground_app_priority");
   119 _LIT8(KGOomConfigForegroundAppPriority, "foreground_app_priority");
   116 
   120 
   120 _LIT8(KGOomAttributeMaxAppCloseBatch, "max_app_close_batch");
   124 _LIT8(KGOomAttributeMaxAppCloseBatch, "max_app_close_batch");
   121 _LIT8(KGOomAttributeDefaultWaitAfterPlugin, "default_wait_after_plugin");
   125 _LIT8(KGOomAttributeDefaultWaitAfterPlugin, "default_wait_after_plugin");
   122 
   126 
   123 //App specific
   127 //App specific
   124 _LIT8(KGOomAttributeTargetFreeOnStartup, "target_free_on_startup");
   128 _LIT8(KGOomAttributeTargetFreeOnStartup, "target_free_on_startup");
       
   129 _LIT8(KGOomAttributeSkipPlugin, "skip_plugin");
   125 
   130 
   126 // System plugins 
   131 // System plugins 
   127 
   132 
   128 _LIT8(KGOomAttributeSystemPluginSettings, "system_plugin_settings");
   133 _LIT8(KGOomAttributeSystemPluginSettings, "system_plugin_settings");
   129 _LIT8(KGOomAttributeSystemPlugin, "system_plugin");
   134 _LIT8(KGOomAttributeSystemPlugin, "system_plugin");
   476                 err = KErrNone;
   481                 err = KErrNone;
   477             
   482             
   478             if (err != KErrNone)
   483             if (err != KErrNone)
   479                 ConfigError(KGOomErrBadTargetFreeValueForAppConfig);
   484                 ConfigError(KGOomErrBadTargetFreeValueForAppConfig);
   480             }
   485             }
       
   486         
       
   487     // Get the app specific SkipPlugin
       
   488         if (err == KErrNone)
       
   489             {
       
   490             TUint skipPlugin;
       
   491             err = GetValueFromHexAttributeList(aAttributes, KGOomAttributeSkipPlugin, skipPlugin);
       
   492             if (err == KErrNone)
       
   493                 {
       
   494                 TRACES2("SKIP PLUGIN %x configured for App %x", skipPlugin, uid); 
       
   495                 appConfig->iSkipPluginId = skipPlugin;
       
   496                 }
       
   497             else if (err == KErrNotFound)
       
   498                 err = KErrNone;
       
   499             
       
   500             if (err != KErrNone)
       
   501                 ConfigError(KGOomErrBadSkipPluginValueForAppConfig);
       
   502             }
       
   503                 
   481     
   504     
   482     // Add the applciation config to the main config
   505     // Add the applciation config to the main config
   483     if ((err == KErrNone) && (appConfig))
   506     if ((err == KErrNone) && (appConfig))
   484         {
   507         {
   485         iConfig.AddApplicationConfigL(appConfig);
   508         iConfig.AddApplicationConfigL(appConfig);
   566         
   589         
   567         if (err != KErrNone)
   590         if (err != KErrNone)
   568             ConfigError(KGOomErrMissingEstimateFromAppCloseConfig);
   591             ConfigError(KGOomErrMissingEstimateFromAppCloseConfig);
   569         else
   592         else
   570             closeAppConfig->iRamEstimate = ramEstimate * 1024;
   593             closeAppConfig->iRamEstimate = ramEstimate * 1024;
   571            }
   594         }
   572 
   595     
   573     if (err == KErrNone)
   596     if (err == KErrNone)
   574         iConfig.SetAppCloseConfigL(closeAppConfig);
   597         {
       
   598         TInt closeTimeout;
       
   599         err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeAppCloseTimeout, closeTimeout);
       
   600         if (err == KErrNone)
       
   601             {
       
   602             closeAppConfig->iCloseTimeout = closeTimeout;
       
   603             }
       
   604         else if (err == KErrNotFound)
       
   605             {
       
   606             closeAppConfig->iCloseTimeout=0;
       
   607             err = KErrNone;
       
   608             }
       
   609         }
       
   610      
       
   611     if (err == KErrNone)
       
   612         {
       
   613         TInt waitAfterClose;
       
   614         err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeAppWaitAfterClose, waitAfterClose);
       
   615         if (err == KErrNone)
       
   616             {
       
   617             closeAppConfig->iWaitAfterClose = waitAfterClose;
       
   618             }
       
   619         else if (err == KErrNotFound)
       
   620             {
       
   621             err = KErrNone;
       
   622             closeAppConfig->iWaitAfterClose = 0;
       
   623             }
       
   624         }
       
   625 
       
   626     if (err == KErrNone)
       
   627         {
       
   628          iConfig.SetAppCloseConfigL(closeAppConfig);
       
   629         }
       
   630     else
       
   631         {
       
   632         TRACES2("ERROR Creating Appcloseconfig file for %x, err %d", uid,err);
       
   633         }
   575     
   634     
   576     CleanupStack::Pop(closeAppConfig);
   635     CleanupStack::Pop(closeAppConfig);
   577     }
   636     }
   578 
   637 
   579 void CGOomConfigParser::SetAppCloseIdlePriorityConfigL(const RAttributeArray& aAttributes)
   638 void CGOomConfigParser::SetAppCloseIdlePriorityConfigL(const RAttributeArray& aAttributes)