Update contrib.
1 // Copyright (c) 2002-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // domain\src\domainpolicy.cpp
18 #include "domainpolicy.h"
20 const TInt KDomainTimeout = 1000000; /* 1000ms */
22 // Domain spec and policy for the domain hierarchy
23 static const TDmDomainSpec DomainHierarchy[] =
25 { KDmIdRoot, KDmIdNone, _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), EPwActive, KDomainTimeout },
26 { KDmIdApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout },
27 { KDmIdUiApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout },
28 // end of array marker
29 { KDmIdNone, KDmIdNone, _INIT_SECURITY_POLICY_PASS, 0, 0 }
32 static const TDmHierarchyPolicy HierarchyPolicyPower =
33 {ETraverseChildrenFirst, ETraverseParentsFirst, ETransitionFailureContinue};
38 Gets access to the domain hierarchy specification.
40 The domain hierarchy specification is a simple array of TDmDomainSpec items.
42 The default implementation provided by Symbian OS just returns a pointer to
43 the domain hierarchy specification array.
45 @return A pointer to the domain hierarchy specification array.
47 EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
49 return (TDmDomainSpec*) DomainHierarchy;
56 Releases access to the specified domain hierarchy specification.
58 The domain hierarchy specification is a simple array of TDmDomainSpec items.
60 As the default Symbian OS implementation of GetDomainSpecs() just returns
61 a pointer to the domain hierarchy specification array, then the default
62 implementation of Release() is empty. The API is provided to permit
63 more complex implementations, if required.
65 @param aDomainSpec A pointer to the domain hierarchy specification array.
67 EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
73 Retrieves the domain hierarchy policy.
75 @param aPolicy a client-supplied policy which on exit
76 will contain a copy of the policy for the requested domain hierarchy Id.
81 EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
83 aPolicy = HierarchyPolicyPower;