tstaskmonitor/server/src/hsdataprovidertask.cpp
changeset 102 8b8b34fa9751
parent 100 0920c6a9b6c8
child 106 e78d6e055a5b
equal deleted inserted replaced
100:0920c6a9b6c8 102:8b8b34fa9751
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 #include "hsdataprovidertask.h"
       
    18 #include "tstaskmonitorglobals.h"
       
    19 
       
    20 // -----------------------------------------------------------------------------
       
    21 //
       
    22 // -----------------------------------------------------------------------------
       
    23 //
       
    24 void HsDataProviderTask::ExecuteL(const MHsDataProvider& provider, const RMessage2& msg)
       
    25 {
       
    26     switch (msg.Function()) {
       
    27     case GetRunningAppInfo:
       
    28         msg.WriteL(KRequestDataSizeOffset, TPckgBuf<TInt>(provider.Data().Length()));
       
    29         msg.Complete(KErrNone);
       
    30         break;
       
    31     
       
    32     case FlushData:
       
    33         if (provider.Data().Length() > msg.GetDesMaxLengthL(KRequestDataBufferOffset)) {
       
    34             User::Leave(KErrCorrupt);
       
    35         }
       
    36         msg.WriteL(KRequestDataBufferOffset, provider.Data());
       
    37         msg.Complete(KErrNone);
       
    38         break;
       
    39     }
       
    40 }