sysstatemgmt/systemstatemgr/dompolicy/src/domainpolicy2.cpp
author hgs
Fri, 08 Oct 2010 14:33:25 +0300
changeset 76 cb32bcc88bad
parent 0 4e1aa6a622a0
child 77 8a984d260a2d
permissions -rw-r--r--
201039
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
76
hgs
parents: 0
diff changeset
     1
// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
// All rights reserved.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
//
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
// Initial Contributors:
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
//
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
// Contributors:
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
//
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
// Description:
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
//
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
#include "ssmdomaindefs.h"
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
#include "ssmsubstates.hrh"
76
hgs
parents: 0
diff changeset
    18
#ifdef SYMBIAN_INCLUDE_APP_CENTRIC
hgs
parents: 0
diff changeset
    19
#include "ssmstates.hrh"
hgs
parents: 0
diff changeset
    20
#endif //SYMBIAN_INCLUDE_APP_CENTRIC
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#ifdef __WINS__
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
const TInt KStateTransitionTimeout = 30000000; /* 30 seconds */
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#else
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
const TInt KStateTransitionTimeout = 10000000; /* 10 seconds */
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#endif
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
76
hgs
parents: 0
diff changeset
    28
#ifdef SYMBIAN_INCLUDE_APP_CENTRIC
hgs
parents: 0
diff changeset
    29
const TInt KStateDeferredLimit = 1; /* 1 time */
hgs
parents: 0
diff changeset
    30
const TInt KMemberTimeout = 5; /* 5msec */
hgs
parents: 0
diff changeset
    31
#endif //SYMBIAN_INCLUDE_APP_CENTRIC
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
/*
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
Domain specification and policy for the startup domain hierarchy
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
*/
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
static const TDmDomainSpec DomainHierarchy[] =
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
	{
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
		{ KSM2HALDomain3,				KDmIdNone,					_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
		{ KSM2KernelServicesDomain3,	KSM2HALDomain3,				_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
		{ KSM2OSServicesDomain3,		KSM2KernelServicesDomain3,	_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
		{ KSM2GenMiddlewareDomain3,		KSM2OSServicesDomain3,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
		{ KSM2GenMiddlewareDomain4,		KSM2GenMiddlewareDomain3,	_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined,	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
		{ KSM2AppServicesDomain3,		KSM2GenMiddlewareDomain4,	_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
		{ KSM2AppServicesDomain4,		KSM2AppServicesDomain3,	    _INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
		{ KSM2UiServicesDomain3,		KSM2AppServicesDomain4,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
		{ KSM2UiApplicationDomain3,		KSM2UiServicesDomain3,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
		// end of array marker
76
hgs
parents: 0
diff changeset
    48
		TDM_DOMAIN_SPEC_END
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
	};
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
76
hgs
parents: 0
diff changeset
    51
#ifdef SYMBIAN_INCLUDE_APP_CENTRIC
hgs
parents: 0
diff changeset
    52
/**
hgs
parents: 0
diff changeset
    53
 * Note that the transition monitor feature is enabled for states added to StateSpecification array only.
hgs
parents: 0
diff changeset
    54
 */
hgs
parents: 0
diff changeset
    55
static const SDmStateSpecV1 StateSpecification[]=
hgs
parents: 0
diff changeset
    56
    {
hgs
parents: 0
diff changeset
    57
        {(ESsmShutdown << 16 | ESsmShutdownSubStateCritical), KMemberTimeout, KStateDeferredLimit, ETransitionFailureUsePolicyFromOrdinal3},
hgs
parents: 0
diff changeset
    58
        {(ESsmShutdown << 16 | ESsmShutdownSubStateNonCritical), KMemberTimeout, KStateDeferredLimit, ETransitionFailureUsePolicyFromOrdinal3}
hgs
parents: 0
diff changeset
    59
           
hgs
parents: 0
diff changeset
    60
    };
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    61
76
hgs
parents: 0
diff changeset
    62
hgs
parents: 0
diff changeset
    63
#endif //SYMBIAN_INCLUDE_APP_CENTRIC
0
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    64
/*
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    65
Note that the _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData) is not used for the root domain, since this refers to the capabilities of
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
the SSA components connecting to the Start-up Domain Hierarchy. No capabilities are required by SSA components to attach to the Start-up Domain Hierarchy.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
*/
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    69
// Policy for traversal of the startup Domain Hierarchy. Only positive transitions should take place
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    70
static const TDmHierarchyPolicy HierarchyPolicyStartup	=
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    71
	{ETraverseParentsFirst, ETraverseParentsFirst, ETransitionFailureContinue};
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    72
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    73
/**
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    74
Gets access to the domain hierarchy specification.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
The domain hierarchy specification is a simple array of TDmDomainSpec items.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    77
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    78
The default implementation provided by Symbian OS just returns a pointer to
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
the domain hierarchy specification array.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    81
@return A pointer to the domain hierarchy specification array.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
*/
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    83
EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    84
	{
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    85
	return (TDmDomainSpec*) DomainHierarchy;
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    86
	}
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    87
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    88
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    89
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    90
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
/**
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
Releases access to the specified domain hierarchy specification.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    94
The domain hierarchy specification is a simple array of TDmDomainSpec items.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
As the default Symbian OS implementation of GetDomainSpecs() just returns
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
a pointer to the domain hierarchy specification array, then the default
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
implementation of Release() is empty. The API is provided to permit
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
more complex implementations, if required.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
@param aDomainSpec A pointer to the domain hierarchy specification array.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
*/
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
	{
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   105
	}
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   106
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   107
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
/**
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
Retrieves the domain hierarchy policy.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
@param	aPolicy a client-supplied policy which on exit
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
		will contain a copy of the policy for the requested domain hierarchy Id.
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
@return	KErrNone
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
*/
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
	{
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
	aPolicy = HierarchyPolicyStartup;
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
	return KErrNone;
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
	}
4e1aa6a622a0 Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
76
hgs
parents: 0
diff changeset
   122
/**
hgs
parents: 0
diff changeset
   123
Retrieves the state specification array.
hgs
parents: 0
diff changeset
   124
The domain manager retrieves the StateSpecification array to read the state for which the transition
hgs
parents: 0
diff changeset
   125
monitoring feature has to be enabled.
hgs
parents: 0
diff changeset
   126
This should be present in the oridinal4 of the domainpolicy def file.
hgs
parents: 0
diff changeset
   127
hgs
parents: 0
diff changeset
   128
@param aPtr  Will have the state specification structure used in the array .
hgs
parents: 0
diff changeset
   129
@param aNumElements Will hold the number of elements in the array.
hgs
parents: 0
diff changeset
   130
hgs
parents: 0
diff changeset
   131
@return will return the version of the domain policy if the feature is enabled or else returns KErrNotSupported.
hgs
parents: 0
diff changeset
   132
 */
hgs
parents: 0
diff changeset
   133
#ifdef SYMBIAN_INCLUDE_APP_CENTRIC
hgs
parents: 0
diff changeset
   134
EXPORT_C  TInt DmPolicy::GetStateSpec(TAny*& aPtr, TUint& aNumElements)
hgs
parents: 0
diff changeset
   135
    {
hgs
parents: 0
diff changeset
   136
    TInt version = KErrNotSupported;
hgs
parents: 0
diff changeset
   137
    aPtr = (TAny*) StateSpecification;
hgs
parents: 0
diff changeset
   138
    aNumElements = sizeof(StateSpecification)/sizeof(SDmStateSpecV1);    
hgs
parents: 0
diff changeset
   139
    version = KSDmStateSpecV1;
hgs
parents: 0
diff changeset
   140
    return version;    
hgs
parents: 0
diff changeset
   141
    }
hgs
parents: 0
diff changeset
   142
#else
hgs
parents: 0
diff changeset
   143
EXPORT_C  TInt DmPolicy::GetStateSpec(TAny*& aPtr, TUint& aNumElements)
hgs
parents: 0
diff changeset
   144
    {
hgs
parents: 0
diff changeset
   145
    aPtr = NULL;
hgs
parents: 0
diff changeset
   146
    aNumElements = 0;
hgs
parents: 0
diff changeset
   147
    return KErrNotSupported;  
hgs
parents: 0
diff changeset
   148
    }
hgs
parents: 0
diff changeset
   149
#endif //SYMBIAN_INCLUDE_APP_CENTRIC
hgs
parents: 0
diff changeset
   150
hgs
parents: 0
diff changeset
   151
/**
hgs
parents: 0
diff changeset
   152
Defines the function type for a static function that is implemented by
hgs
parents: 0
diff changeset
   153
a device's domain policy DLL at ordinal 5. 
hgs
parents: 0
diff changeset
   154
The domain manager uses this function to release the state specification returned by ordinal 4. 
hgs
parents: 0
diff changeset
   155
The implementation may be empty and simply return if no release action needs 
hgs
parents: 0
diff changeset
   156
to be taken.
hgs
parents: 0
diff changeset
   157
 */
hgs
parents: 0
diff changeset
   158
EXPORT_C void DmPolicy::ReleaseStateSpec(TAny* /*aStateSpec*/)
hgs
parents: 0
diff changeset
   159
    {
hgs
parents: 0
diff changeset
   160
    }
hgs
parents: 0
diff changeset
   161