sysstatemgmt/systemstatemgr/dompolicy/src/domainpolicy2.cpp
changeset 0 4e1aa6a622a0
child 76 cb32bcc88bad
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2005-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 #include "ssmdomaindefs.h"
       
    17 #include "ssmsubstates.hrh"
       
    18 
       
    19 #ifdef __WINS__
       
    20 const TInt KStateTransitionTimeout = 30000000; /* 30 seconds */
       
    21 #else
       
    22 const TInt KStateTransitionTimeout = 10000000; /* 10 seconds */
       
    23 #endif
       
    24 
       
    25 /*
       
    26 Domain specification and policy for the startup domain hierarchy
       
    27 */
       
    28 
       
    29 static const TDmDomainSpec DomainHierarchy[] =
       
    30 	{
       
    31 		{ KSM2HALDomain3,				KDmIdNone,					_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
       
    32 		{ KSM2KernelServicesDomain3,	KSM2HALDomain3,				_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
       
    33 		{ KSM2OSServicesDomain3,		KSM2KernelServicesDomain3,	_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout},
       
    34 		{ KSM2GenMiddlewareDomain3,		KSM2OSServicesDomain3,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined,	KStateTransitionTimeout },
       
    35 		{ KSM2GenMiddlewareDomain4,		KSM2GenMiddlewareDomain3,	_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined,	KStateTransitionTimeout },
       
    36 		{ KSM2AppServicesDomain3,		KSM2GenMiddlewareDomain4,	_INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
       
    37 		{ KSM2AppServicesDomain4,		KSM2AppServicesDomain3,	    _INIT_SECURITY_POLICY_PASS, ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
       
    38 		{ KSM2UiServicesDomain3,		KSM2AppServicesDomain4,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
       
    39 		{ KSM2UiApplicationDomain3,		KSM2UiServicesDomain3,		_INIT_SECURITY_POLICY_PASS,	ESsmStartupSubStateUndefined, 	KStateTransitionTimeout },
       
    40 		// end of array marker
       
    41 		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,				0,			0		}
       
    42 	};
       
    43 
       
    44 
       
    45 /*
       
    46 Note that the _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData) is not used for the root domain, since this refers to the capabilities of
       
    47 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.
       
    48 */
       
    49 
       
    50 // Policy for traversal of the startup Domain Hierarchy. Only positive transitions should take place
       
    51 static const TDmHierarchyPolicy HierarchyPolicyStartup	=
       
    52 	{ETraverseParentsFirst, ETraverseParentsFirst, ETransitionFailureContinue};
       
    53 
       
    54 /**
       
    55 Gets access to the domain hierarchy specification.
       
    56 
       
    57 The domain hierarchy specification is a simple array of TDmDomainSpec items.
       
    58 
       
    59 The default implementation provided by Symbian OS just returns a pointer to
       
    60 the domain hierarchy specification array.
       
    61 
       
    62 @return A pointer to the domain hierarchy specification array.
       
    63 */
       
    64 EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
       
    65 	{
       
    66 	return (TDmDomainSpec*) DomainHierarchy;
       
    67 	}
       
    68 
       
    69 
       
    70 
       
    71 
       
    72 /**
       
    73 Releases access to the specified domain hierarchy specification.
       
    74 
       
    75 The domain hierarchy specification is a simple array of TDmDomainSpec items.
       
    76 
       
    77 As the default Symbian OS implementation of GetDomainSpecs() just returns
       
    78 a pointer to the domain hierarchy specification array, then the default
       
    79 implementation of Release() is empty. The API is provided to permit
       
    80 more complex implementations, if required.
       
    81 
       
    82 @param aDomainSpec A pointer to the domain hierarchy specification array.
       
    83 */
       
    84 EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
       
    85 	{
       
    86 	}
       
    87 
       
    88 
       
    89 /**
       
    90 Retrieves the domain hierarchy policy.
       
    91 
       
    92 @param	aPolicy a client-supplied policy which on exit
       
    93 		will contain a copy of the policy for the requested domain hierarchy Id.
       
    94 
       
    95 @return	KErrNone
       
    96 */
       
    97 EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
       
    98 	{
       
    99 	aPolicy = HierarchyPolicyStartup;
       
   100 	return KErrNone;
       
   101 	}
       
   102