1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/domainmgr/src/domainpolicy.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,86 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// domain\src\domainpolicy.cpp
1.18 +//
1.19 +//
1.20 +
1.21 +#include "domainpolicy.h"
1.22 +
1.23 +const TInt KDomainTimeout = 1000000; /* 1000ms */
1.24 +
1.25 +// Domain spec and policy for the domain hierarchy
1.26 +static const TDmDomainSpec DomainHierarchy[] =
1.27 + {
1.28 + { KDmIdRoot, KDmIdNone, _INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData), EPwActive, KDomainTimeout },
1.29 + { KDmIdApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout },
1.30 + { KDmIdUiApps, KDmIdRoot, _INIT_SECURITY_POLICY_PASS, EPwActive, KDomainTimeout },
1.31 + // end of array marker
1.32 + { KDmIdNone, KDmIdNone, _INIT_SECURITY_POLICY_PASS, 0, 0 }
1.33 + };
1.34 +
1.35 +static const TDmHierarchyPolicy HierarchyPolicyPower =
1.36 + {ETraverseChildrenFirst, ETraverseParentsFirst, ETransitionFailureContinue};
1.37 +
1.38 +
1.39 +
1.40 +/**
1.41 +Gets access to the domain hierarchy specification.
1.42 +
1.43 +The domain hierarchy specification is a simple array of TDmDomainSpec items.
1.44 +
1.45 +The default implementation provided by Symbian OS just returns a pointer to
1.46 +the domain hierarchy specification array.
1.47 +
1.48 +@return A pointer to the domain hierarchy specification array.
1.49 +*/
1.50 +EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
1.51 + {
1.52 + return (TDmDomainSpec*) DomainHierarchy;
1.53 + }
1.54 +
1.55 +
1.56 +
1.57 +
1.58 +/**
1.59 +Releases access to the specified domain hierarchy specification.
1.60 +
1.61 +The domain hierarchy specification is a simple array of TDmDomainSpec items.
1.62 +
1.63 +As the default Symbian OS implementation of GetDomainSpecs() just returns
1.64 +a pointer to the domain hierarchy specification array, then the default
1.65 +implementation of Release() is empty. The API is provided to permit
1.66 +more complex implementations, if required.
1.67 +
1.68 +@param aDomainSpec A pointer to the domain hierarchy specification array.
1.69 +*/
1.70 +EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
1.71 + {
1.72 + }
1.73 +
1.74 +
1.75 +/**
1.76 +Retrieves the domain hierarchy policy.
1.77 +
1.78 +@param aPolicy a client-supplied policy which on exit
1.79 + will contain a copy of the policy for the requested domain hierarchy Id.
1.80 +
1.81 +
1.82 +@return KErrNone
1.83 +*/
1.84 +EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
1.85 + {
1.86 + aPolicy = HierarchyPolicyPower;
1.87 + return KErrNone;
1.88 + }
1.89 +