sysstatemgmt/systemstateplugins/adptplugin/inc/simadaptationref.h
changeset 0 4e1aa6a622a0
child 41 c87e5f80c17d
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __SIMADAPTATIONREF_H__
       
    17 #define __SIMADAPTATIONREF_H__
       
    18 
       
    19 #include <ssm/ssmadaptation.h>
       
    20 
       
    21 /**
       
    22 
       
    23  CSimAdaptationRefEventHandler acts as a dummy event notifier in the absence of Cooperating system
       
    24 
       
    25   *********Need for the class*********
       
    26   
       
    27   On a device when NotifySimEvent is called, Sim Adaptation Plug-in would request for notification 
       
    28   from the Cooperating System for 'aEvent'.
       
    29   
       
    30   On HRP/Techview,the reference implementation has to complete the notification request with KErrNotSupported
       
    31   since there is no Cooperating System on HRP/Techview.
       
    32   
       
    33   But this implementation will cause problems in the following scenario.
       
    34   
       
    35   *********Problem*********
       
    36   
       
    37   This API is used by Adaptation server to service the clients which request for notifications .
       
    38   This is done as follows.
       
    39   
       
    40   Adaptation server always tracks the events by calling NotifySimEvent during the whole life time 
       
    41   of the server.It first calls this API in the startup of the server and subsequently whenever an event 
       
    42   is notified(by completing the call NotifySimEvent) adaptation server resubmits the request 
       
    43   by calling NotifySimEvent .
       
    44   
       
    45   In this context if NotifySimEvent just completes the message immediately this results in a infinite 
       
    46   loop and starves other active objects with same priority.
       
    47   
       
    48   This makes testing of Adaptation servers notification functionality impossible on HRP/Techview.
       
    49   
       
    50   *********Solution*********
       
    51 
       
    52   To solve this problem NotifySimEvent will forward the notification request from adaptation server 
       
    53   to the test active object(CSimAdaptationRefEventHandler) which has lesser priority compared to 
       
    54   adaptation servers active object.
       
    55   In the RunL() method of this test active object the notification request is completed.  
       
    56   
       
    57   This will delay the completion of notification message till all the servers active objects 
       
    58   which have higher priority are run.
       
    59   
       
    60   @internalComponent
       
    61   
       
    62    
       
    63 */
       
    64 
       
    65 
       
    66 class CSimRefAdaptationTimer : public CTimer
       
    67 	{
       
    68 public:
       
    69 	CSimRefAdaptationTimer();
       
    70 	~CSimRefAdaptationTimer();
       
    71 	static CSimRefAdaptationTimer* NewL();
       
    72 	void After(TTimeIntervalMicroSeconds32 aCancelDelay, TRequestStatus& aStatus);	
       
    73 	void DoCancel();
       
    74 private:
       
    75 	virtual void RunL();
       
    76 
       
    77 private:
       
    78 	TRequestStatus* iReqStatus;
       
    79 	};
       
    80 
       
    81 
       
    82 // C Class
       
    83 class CSimAdaptationRef : public CBase, public MSimAdaptation
       
    84 	{
       
    85 public:
       
    86 	static CSimAdaptationRef* NewL();
       
    87 	~CSimAdaptationRef();
       
    88 
       
    89 	//from MSimAdaptation
       
    90 	void Release();
       
    91 	void GetSimOwned(TDes8& aOwnedPckg, TRequestStatus& aStatus);
       
    92 	void GetCancel();
       
    93 
       
    94 	void NotifySimEvent(TDes8& aTypePckg, TRequestStatus& aStatus);
       
    95 	void NotifyCancel();
       
    96 
       
    97 private:
       
    98 	CSimAdaptationRef();
       
    99 	void ConstructL();
       
   100 private:
       
   101 	CSimRefAdaptationTimer* iTimer;
       
   102 	};
       
   103 
       
   104 
       
   105 
       
   106 
       
   107 
       
   108 
       
   109 #endif // __SIMADAPTATIONREF_H__