halservices/hal/src/hal_main.cpp
branchRCL_3
changeset 28 5b5d147c7838
parent 0 a41df078684a
equal deleted inserted replaced
26:c734af59ce98 28:5b5d147c7838
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1999-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of the License "Eclipse Public License v1.0"
     4 // under the terms of the License "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   117 		TInt i=ENumHalAttributes-1;
   117 		TInt i=ENumHalAttributes-1;
   118 		for (; i>=0; --i)
   118 		for (; i>=0; --i)
   119 			{
   119 			{
   120 			TInt offset = device*(TInt)ENumHalAttributes + i;
   120 			TInt offset = device*(TInt)ENumHalAttributes + i;
   121 			TInt properties=HalInternal::Properties[i];
   121 			TInt properties=HalInternal::Properties[i];
   122 			if (properties & HAL::EValid)
   122 			// Exclusion of the EDisplayMemoryHandle attribute is a work around
       
   123 			// to avoid the handle and resources related to it from being 
       
   124 			// allocated. Callers of this API (halsettings - to save modifiable 
       
   125 			// atrributes) need to avoid this resource overhead. Clients of 
       
   126 			// this attribute need to use HAL::Get() directly.
       
   127 			// HAL should not be used for handle opening and this
       
   128 			// attribute should be replaced with a better API.
       
   129 			if ((properties & HAL::EValid) && (i != EDisplayMemoryHandle))
   123 				{
   130 				{
   124 				THalImplementation f=HalInternal::Implementation[i];
   131 				THalImplementation f=HalInternal::Implementation[i];
   125 				if (f)
   132 				if (f)
   126 					{
   133 					{
   127 					// Initialise the value before getting it, for consistancy
   134 					// Initialise the value before getting it, for consistancy