os/kernelhwsrv/userlibandfileserver/domainmgr/src/domainpolicy.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // domain\src\domainpolicy.cpp
    15 // 
    16 //
    17 
    18 #include "domainpolicy.h"
    19 
    20 const TInt KDomainTimeout = 1000000; /* 1000ms */
    21 
    22 // Domain spec and policy for the domain hierarchy
    23 static const TDmDomainSpec DomainHierarchy[] = 
    24 	{
    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	}	
    30 	};
    31 
    32 static const TDmHierarchyPolicy HierarchyPolicyPower	= 
    33 	{ETraverseChildrenFirst, ETraverseParentsFirst, ETransitionFailureContinue};
    34 
    35 
    36 
    37 /**
    38 Gets access to the domain hierarchy specification.
    39 
    40 The domain hierarchy specification is a simple array of TDmDomainSpec items.
    41 
    42 The default implementation provided by Symbian OS just returns a pointer to
    43 the domain hierarchy specification array.
    44 
    45 @return A pointer to the domain hierarchy specification array.
    46 */
    47 EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
    48 	{
    49 	return (TDmDomainSpec*) DomainHierarchy;
    50 	}
    51 
    52 
    53 
    54 
    55 /**
    56 Releases access to the specified domain hierarchy specification.
    57 
    58 The domain hierarchy specification is a simple array of TDmDomainSpec items.
    59 
    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.
    64 
    65 @param aDomainSpec A pointer to the domain hierarchy specification array.
    66 */
    67 EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
    68 	{
    69 	}
    70 
    71 
    72 /**
    73 Retrieves the domain hierarchy policy. 
    74 
    75 @param	aPolicy a client-supplied policy which on exit
    76 		will contain a copy of the policy for the requested domain hierarchy Id.
    77 
    78   
    79 @return	KErrNone
    80 */
    81 EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
    82 	{
    83 	aPolicy = HierarchyPolicyPower;
    84 	return KErrNone;
    85 	}
    86