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.
sl@0
     1
// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// domain\src\domainpolicy.cpp
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
#include "domainpolicy.h"
sl@0
    19
sl@0
    20
const TInt KDomainTimeout = 1000000; /* 1000ms */
sl@0
    21
sl@0
    22
// Domain spec and policy for the domain hierarchy
sl@0
    23
static const TDmDomainSpec DomainHierarchy[] = 
sl@0
    24
	{
sl@0
    25
		{ KDmIdRoot,	KDmIdNone,	_INIT_SECURITY_POLICY_C1(ECapabilityWriteDeviceData),	EPwActive,	KDomainTimeout	},
sl@0
    26
		{ KDmIdApps,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,								EPwActive,	KDomainTimeout	},
sl@0
    27
		{ KDmIdUiApps,	KDmIdRoot,	_INIT_SECURITY_POLICY_PASS,								EPwActive,	KDomainTimeout	},
sl@0
    28
		// end of array marker
sl@0
    29
		{ KDmIdNone,	KDmIdNone,	_INIT_SECURITY_POLICY_PASS,								0,			0	}	
sl@0
    30
	};
sl@0
    31
sl@0
    32
static const TDmHierarchyPolicy HierarchyPolicyPower	= 
sl@0
    33
	{ETraverseChildrenFirst, ETraverseParentsFirst, ETransitionFailureContinue};
sl@0
    34
sl@0
    35
sl@0
    36
sl@0
    37
/**
sl@0
    38
Gets access to the domain hierarchy specification.
sl@0
    39
sl@0
    40
The domain hierarchy specification is a simple array of TDmDomainSpec items.
sl@0
    41
sl@0
    42
The default implementation provided by Symbian OS just returns a pointer to
sl@0
    43
the domain hierarchy specification array.
sl@0
    44
sl@0
    45
@return A pointer to the domain hierarchy specification array.
sl@0
    46
*/
sl@0
    47
EXPORT_C const TDmDomainSpec* DmPolicy::GetDomainSpecs()
sl@0
    48
	{
sl@0
    49
	return (TDmDomainSpec*) DomainHierarchy;
sl@0
    50
	}
sl@0
    51
sl@0
    52
sl@0
    53
sl@0
    54
sl@0
    55
/**
sl@0
    56
Releases access to the specified domain hierarchy specification.
sl@0
    57
sl@0
    58
The domain hierarchy specification is a simple array of TDmDomainSpec items.
sl@0
    59
sl@0
    60
As the default Symbian OS implementation of GetDomainSpecs() just returns
sl@0
    61
a pointer to the domain hierarchy specification array, then the default
sl@0
    62
implementation of Release() is empty. The API is provided to permit
sl@0
    63
more complex implementations, if required.
sl@0
    64
sl@0
    65
@param aDomainSpec A pointer to the domain hierarchy specification array.
sl@0
    66
*/
sl@0
    67
EXPORT_C void DmPolicy::Release(const TDmDomainSpec* /*aDomainSpec*/)
sl@0
    68
	{
sl@0
    69
	}
sl@0
    70
sl@0
    71
sl@0
    72
/**
sl@0
    73
Retrieves the domain hierarchy policy. 
sl@0
    74
sl@0
    75
@param	aPolicy a client-supplied policy which on exit
sl@0
    76
		will contain a copy of the policy for the requested domain hierarchy Id.
sl@0
    77
sl@0
    78
  
sl@0
    79
@return	KErrNone
sl@0
    80
*/
sl@0
    81
EXPORT_C TInt DmPolicy::GetPolicy(TDmHierarchyPolicy& aPolicy)
sl@0
    82
	{
sl@0
    83
	aPolicy = HierarchyPolicyPower;
sl@0
    84
	return KErrNone;
sl@0
    85
	}
sl@0
    86