sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // domain\src\domainpolicy.cpp sl@0: // sl@0: // sl@0: sl@0: #include "domainpolicy.h" sl@0: sl@0: const TInt KDomainTimeout = 1000000; /* 1000ms */ sl@0: sl@0: // Domain spec and policy for the domain hierarchy sl@0: static const TDmDomainSpec DomainHierarchy[] = sl@0: { sl@0: { KDmIdRoot, KDmIdNone, _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), EPwActive, KDomainTimeout }, sl@0: { KDmIdApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout }, sl@0: { KDmIdUiApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout }, sl@0: // end of array marker sl@0: { KDmIdNone, KDmIdNone, _INIT_SECURITY_POLICY_PASS, 0, 0 } sl@0: }; sl@0: sl@0: static const TDmHierarchyPolicy HierarchyPolicyPower = sl@0: {ETraverseChildrenFirst, ETraverseParentsFirst, ETransitionFailureContinue}; sl@0: sl@0: sl@0: sl@0: /** sl@0: Gets access to the domain hierarchy specification. sl@0: sl@0: The domain hierarchy specification is a simple array of TDmDomainSpec items. sl@0: sl@0: The default implementation provided by Symbian OS just returns a pointer to sl@0: the domain hierarchy specification array. sl@0: sl@0: @return A pointer to the domain hierarchy specification array. sl@0: */ sl@0: EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs() sl@0: { sl@0: return (TDmDomainSpec*) DomainHierarchy; sl@0: } sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: Releases access to the specified domain hierarchy specification. sl@0: sl@0: The domain hierarchy specification is a simple array of TDmDomainSpec items. sl@0: sl@0: As the default Symbian OS implementation of GetDomainSpecs() just returns sl@0: a pointer to the domain hierarchy specification array, then the default sl@0: implementation of Release() is empty. The API is provided to permit sl@0: more complex implementations, if required. sl@0: sl@0: @param aDomainSpec A pointer to the domain hierarchy specification array. sl@0: */ sl@0: EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/) sl@0: { sl@0: } sl@0: sl@0: sl@0: /** sl@0: Retrieves the domain hierarchy policy. sl@0: sl@0: @param aPolicy a client-supplied policy which on exit sl@0: will contain a copy of the policy for the requested domain hierarchy Id. sl@0: sl@0: sl@0: @return KErrNone sl@0: */ sl@0: EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy) sl@0: { sl@0: aPolicy = HierarchyPolicyPower; sl@0: return KErrNone; sl@0: } sl@0: