sysresmonitoring/oommonitor/tsrc/ut_oom_memorymonitor/src/mockoomforegroundrule.cpp
changeset 77 b01c07dfcf84
equal deleted inserted replaced
74:1505405bc645 77:b01c07dfcf84
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Configuration representation classes for Out of Memory Monitor.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "oomforegroundrule.h"
       
    20 #include "oomwindowgrouplist.h"
       
    21 #include "OomTraces.h"
       
    22 
       
    23 // If the specified target app is in the foreground then apply the specified priority
       
    24 COomForegroundRule::COomForegroundRule(TInt aTargetAppId, TInt aPriority) : iTargetAppId(aTargetAppId), iPriority(aPriority)
       
    25     {
       
    26     FUNC_LOG;
       
    27     }
       
    28 
       
    29 TBool COomForegroundRule::RuleIsApplicable(const COomWindowGroupList& aWindowGroupList, TInt /*aAppIndexInWindowGroup*/) const
       
    30     {
       
    31     FUNC_LOG;
       
    32 
       
    33     TBool ruleIsApplicable = EFalse;
       
    34     if (aWindowGroupList.Count() > 0)
       
    35         {
       
    36         // If the target app is in the foreground then this rule is applicable
       
    37         TUint foregroundAppId = aWindowGroupList.AppId(0, ETrue);
       
    38         if (foregroundAppId == iTargetAppId)
       
    39             ruleIsApplicable = ETrue;
       
    40         }
       
    41     
       
    42     return ruleIsApplicable;
       
    43     }