sl@0: /* sl@0: * Copyright (c) 2007-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: * Implements an interface to keep and access decision record fields. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: #include sl@0: #include sl@0: #include sl@0: #include "upslog.h" sl@0: #include sl@0: #include "upscommon.h" sl@0: sl@0: namespace UserPromptService { sl@0: sl@0: CDecisionRecord::CDecisionRecord() sl@0: /** sl@0: Constructor for the decision record. sl@0: */ sl@0: { sl@0: sl@0: } sl@0: sl@0: CDecisionRecord::CDecisionRecord(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid, sl@0: const TUint8 aResult, const TUint16& aMajorPolicyVersion, const TUint32 aEvaluatorInfo, const TUint32& aRecordId) sl@0: /** sl@0: Constructor for the decision record. Assigns the ID values. sl@0: */ sl@0: :iClientSid(aClientSid),iEvaluatorId(aEvaluatorId), sl@0: iServiceId(aServiceId),iServerSid(aServerSid), sl@0: iResult(aResult),iMajorPolicyVersion(aMajorPolicyVersion), sl@0: iRecordId(aRecordId),iEvaluatorInfo(aEvaluatorInfo) sl@0: { sl@0: sl@0: } sl@0: sl@0: sl@0: CDecisionRecord::~CDecisionRecord() sl@0: /** sl@0: Destructor for the decision record object sl@0: */ sl@0: { sl@0: iFingerprint.Close(); sl@0: iClientEntity.Close(); sl@0: iDescription.Close(); sl@0: } sl@0: sl@0: EXPORT_C CDecisionRecord* CDecisionRecord::NewL(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid, sl@0: const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TDesC& aDescription, const TUint8 aResult, sl@0: const TUint16& aMajorPolicyVersion, const TUint32 aEvaluatorInfo, const TUint32& aRecordId) sl@0: /** sl@0: Creates a decision record object. The function leaves, if creation of the record object fails. sl@0: sl@0: @param aClientSid Secure Id of client application sl@0: @param aEvaluatorId UID for the policy evaluator DLL sl@0: @param aServiceId UID for service e.g. sms, mms, telephony, gprs sl@0: @param aServerSid Secure Id for the system server that the decision applies to sl@0: @param aFingerprint Hash of the destination and/or opaque data. Maximum length is 32 bytes. sl@0: @param aClientEntity The name of the entity within the client that requested the service. Maximum length is 32 bytes. sl@0: @param aDescription A copy of description and/or opaque. sl@0: @param aResult Whether the request should be approved (=1) or denied (=0) sl@0: @param aMajorPolicyVersion The major version of the policy file. sl@0: @param aEvaluatorInfo Policy evaluator specific data sl@0: @param aRecordId An auto-incrementing record number. sl@0: sl@0: @return A pointer to the newly allocated decision record object, if creation is successful. sl@0: */ sl@0: { sl@0: CDecisionRecord* self = CDecisionRecord::NewLC(aClientSid,aEvaluatorId,aServiceId,aServerSid,aFingerprint,aClientEntity, sl@0: aDescription,aResult,aMajorPolicyVersion,aEvaluatorInfo,aRecordId); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CDecisionRecord* CDecisionRecord::NewLC(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid, sl@0: const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TDesC& aDescription, const TUint8 aResult, sl@0: const TUint16& aMajorPolicyVersion, const TUint32 aEvaluatorInfo, const TUint32& aRecordId) sl@0: /** sl@0: Creates a decision record object. The function leaves, if creation of the record object fails. sl@0: sl@0: @return A pointer to the newly allocated decision record object, if creation is successful. sl@0: The pointer is also put onto the cleanup stack. sl@0: @see CDecisionRecord::NewL() sl@0: */ sl@0: { sl@0: CDecisionRecord* self = new (ELeave) CDecisionRecord(aClientSid,aEvaluatorId,aServiceId,aServerSid,aResult, sl@0: aMajorPolicyVersion,aEvaluatorInfo,aRecordId); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aFingerprint,aClientEntity,aDescription); sl@0: return self; sl@0: } sl@0: sl@0: EXPORT_C CDecisionRecord* CDecisionRecord::NewLC() sl@0: /** sl@0: Creates a decision record object. The function leaves, if creation of the record object fails. sl@0: sl@0: @return A pointer to the newly allocated decision record object, if creation is successful. sl@0: The pointer is also put onto the cleanup stack. sl@0: */ sl@0: { sl@0: CDecisionRecord* self = new (ELeave) CDecisionRecord(); sl@0: CleanupStack::PushL(self); sl@0: return self; sl@0: } sl@0: sl@0: void CDecisionRecord::ConstructL(const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TDesC& aDescription) sl@0: /** sl@0: Second phase constructor for the decision record. Sets members allocated on the heap. sl@0: The function leaves, if any buffer allocation fails. sl@0: @see CDecisionRecord::NewL() sl@0: */ sl@0: { sl@0: sl@0: iFingerprint.CreateL(aFingerprint); sl@0: sl@0: iClientEntity.CreateL(aClientEntity); sl@0: sl@0: iDescription.CreateL(aDescription); sl@0: sl@0: ValidateL(); sl@0: } sl@0: sl@0: void CDecisionRecord::ValidateL() sl@0: /** sl@0: Check both the fingerprint and client entity are not too long. sl@0: An absent fingerprint or client entity is represent by an empty string. sl@0: */ sl@0: { sl@0: if(iFingerprint.Length() > (TInt)KUpsMaxFingerprintLength) sl@0: { sl@0: DEBUG_PRINTF2(_L8("The fingerprint length (%d) has not been satisfied during decision construction!"),iFingerprint.Length()); sl@0: User::Leave(KErrUpsBadFingerprintLength); sl@0: } sl@0: sl@0: if(iClientEntity.Length() > (TInt)KUpsMaxClientEntityLength) sl@0: { sl@0: DEBUG_PRINTF2(_L8("The client entity length (%d) has not been satisfied during decision construction!"),iClientEntity.Length()); sl@0: User::Leave(KErrUpsBadClientEntityLength); sl@0: } sl@0: } sl@0: sl@0: EXPORT_C void CDecisionRecord::ExternalizeL(RWriteStream& aStream) const sl@0: /** sl@0: Externalise this CDecisionRecord object to the specified stream. sl@0: */ sl@0: { sl@0: aStream.WriteUint32L(iClientSid.iId); sl@0: aStream.WriteInt32L(iEvaluatorId.iUid); sl@0: aStream.WriteInt32L(iServiceId.iUid); sl@0: aStream.WriteUint32L(iServerSid.iId); sl@0: aStream << iFingerprint; sl@0: aStream << iClientEntity; sl@0: aStream << iDescription; sl@0: aStream << iResult; sl@0: aStream << iMajorPolicyVersion; sl@0: aStream << iRecordId; sl@0: aStream << iEvaluatorInfo; sl@0: } sl@0: sl@0: EXPORT_C void CDecisionRecord::InternalizeL(RReadStream& aStream) sl@0: /** sl@0: Internalise this CDecisionRecord object from the specified stream. sl@0: */ sl@0: { sl@0: iClientSid.iId= aStream.ReadUint32L(); sl@0: iEvaluatorId.iUid = aStream.ReadInt32L(); sl@0: iServiceId.iUid = aStream.ReadInt32L(); sl@0: iServerSid.iId = aStream.ReadUint32L(); sl@0: sl@0: iFingerprint.Close(); sl@0: iFingerprint.CreateL(aStream, KMaskDesLength8); sl@0: sl@0: iClientEntity.Close(); sl@0: iClientEntity.CreateL(aStream, KMaskDesLength8); sl@0: sl@0: iDescription.Close(); sl@0: iDescription.CreateL(aStream, KMaskDesLength16); sl@0: sl@0: aStream >> iResult; sl@0: aStream >> iMajorPolicyVersion; sl@0: aStream >> iRecordId; sl@0: aStream >> iEvaluatorInfo; sl@0: sl@0: ValidateL(); sl@0: } sl@0: sl@0: CDecisionFilter::CDecisionFilter() sl@0: /** sl@0: Constructor for an empty decision filter. sl@0: */ sl@0: { sl@0: sl@0: } sl@0: sl@0: sl@0: CDecisionFilter::CDecisionFilter(const TSecureId& aClientSid, const TUid& aEvaluatorId, sl@0: const TUid& aServiceId, const TSecureId& aServerSid, const TUint16& aVersion) sl@0: :iClientSid(aClientSid),iEvaluatorId(aEvaluatorId),iServiceId(aServiceId), sl@0: iServerSid(aServerSid),iMajorPolicyVersion(aVersion) sl@0: /** sl@0: Constructor for the decision filter. Assigns the ID values. sl@0: */ sl@0: { sl@0: iSetFlag[KPosClientSid] = KSetClientSid | UserPromptService::EEqual; sl@0: iSetFlag[KPosEvaluatorId] = KSetEvaluatorId | UserPromptService::EEqual; sl@0: iSetFlag[KPosServiceId] = KSetServiceId | UserPromptService::EEqual; sl@0: iSetFlag[KPosServerSid] = KSetServerSid | UserPromptService::EEqual; sl@0: iSetFlag[KPosMajorPolicyVersion] = KSetMajorPolicyVersion | UserPromptService::EEqual; sl@0: } sl@0: sl@0: sl@0: CDecisionFilter::~CDecisionFilter() sl@0: /** sl@0: Destructor for the decision filter sl@0: */ sl@0: { sl@0: delete iFingerprint; sl@0: delete iClientEntity; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CDecisionFilter* CDecisionFilter::NewL() sl@0: /** sl@0: Creates an empty filter object. The function is used to define any number of filter keys. sl@0: It leaves, if the creation of the filter object fails. sl@0: sl@0: @return A pointer to the newly allocated filter object, if creation is successful. sl@0: */ sl@0: { sl@0: CDecisionFilter* self = CDecisionFilter::NewLC(); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CDecisionFilter* CDecisionFilter::NewLC() sl@0: /** sl@0: Creates an empty filter object. The function is used to define any number of filter keys. sl@0: It leaves, if the creation of the filter object fails. sl@0: sl@0: @return A pointer to the newly allocated filter object, if creation is successful. sl@0: The pointer is also put onto the cleanup stack. sl@0: */ sl@0: { sl@0: CDecisionFilter* self = new (ELeave) CDecisionFilter(); sl@0: CleanupStack::PushL(self); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CDecisionFilter* CDecisionFilter::NewL(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid, sl@0: const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TUint16& aVersion) sl@0: /** sl@0: Creates a filter object and assigns all filter keys. The function leaves, if creation of the filter object fails. sl@0: sl@0: @param aClientSid Secure Id of client application sl@0: @param aEvaluatorId UID for the policy evaluator DLL sl@0: @param aServiceId UID for service e.g. sms, mms, telephony, gprs sl@0: @param aServerSid Secure Id for the system server that the decision applies to sl@0: @param aFingerprint Hash of the destination and/or opaque data. sl@0: @param aClientEntity The name of the entity within the client that requested the service. sl@0: @param aVersion Major version of policy file. sl@0: @return A pointer to the newly allocated filter object, if creation is successful. sl@0: */ sl@0: { sl@0: CDecisionFilter* self = CDecisionFilter::NewLC(aClientSid,aEvaluatorId,aServiceId,aServerSid,aFingerprint,aClientEntity,aVersion); sl@0: CleanupStack::Pop(self); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CDecisionFilter* CDecisionFilter::NewLC(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid, sl@0: const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TUint16& aVersion) sl@0: /** sl@0: Creates a filter object and assigns all filter keys. The function leaves, if creation of the filter object fails. sl@0: sl@0: @param aClientSid Secure Id of client application sl@0: @param aEvaluatorId UID for the policy evaluator DLL sl@0: @param aServiceId UID for service e.g. sms, mms, telephony, gprs sl@0: @param aServerSid Secure Id for the system server that the decision applies to sl@0: @param aFingerprint Hash of the destination and/or opaque data. sl@0: @param aClientEntity The name of the entity within the client that requested the service. sl@0: @param aVersion Major version of policy file. sl@0: @return A pointer to the newly allocated filter object, if creation is successful. sl@0: The pointer is also put onto the cleanup stack. sl@0: */ sl@0: { sl@0: CDecisionFilter* self = new (ELeave) CDecisionFilter(aClientSid,aEvaluatorId,aServiceId,aServerSid,aVersion); sl@0: CleanupStack::PushL(self); sl@0: self->ConstructL(aFingerprint,aClientEntity); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: void CDecisionFilter::ConstructL(const TDesC8& aFingerprint, const TDesC8& aClientEntity) sl@0: /** sl@0: Second phase constructor for the decision filter. Sets members allocated on the heap. sl@0: The function leaves, if any buffer allocation fails. sl@0: */ sl@0: { sl@0: sl@0: iFingerprint = aFingerprint.AllocL(); sl@0: iSetFlag[KPosFingerprint] |= KSetFingerprint; sl@0: sl@0: iClientEntity = aClientEntity.AllocL(); sl@0: iSetFlag[KPosClientEntity] |= KSetClientEntity; sl@0: sl@0: ValidateL(); sl@0: } sl@0: sl@0: void CDecisionFilter::ValidateL() sl@0: /** sl@0: Check fingerprint and client entity lengths are valid. sl@0: */ sl@0: { sl@0: if((iSetFlag[KPosFingerprint] & KSetFingerprint) && sl@0: ((iFingerprint == 0) || (iFingerprint->Length() > KUpsMaxFingerprintLength))) sl@0: { sl@0: DEBUG_PRINTF2(_L8("The fingerprint length (%d) has not been satisfied during filter construction!"),(iFingerprint) ? (iFingerprint->Length()) : (0)); sl@0: User::Leave(KErrUpsBadFingerprintLength); sl@0: } sl@0: sl@0: if((iSetFlag[KPosClientEntity] & KSetClientEntity) && sl@0: ((iClientEntity == 0) || (iClientEntity->Length() > KUpsMaxClientEntityLength))) sl@0: { sl@0: DEBUG_PRINTF2(_L8("The client entity length (%d) has not been satisfied during filter construction!"),(iClientEntity) ? (iClientEntity->Length()) : (0)); sl@0: User::Leave(KErrUpsBadClientEntityLength); sl@0: } sl@0: } sl@0: sl@0: EXPORT_C void CDecisionFilter::SetClientSid(const TSecureId& aSid, TComparisonOp aOp) sl@0: /** sl@0: Sets the Secure ID of the client application. sl@0: sl@0: @param aUid SID for the client application sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iClientSid = aSid; sl@0: iSetFlag[KPosClientSid] |= KSetClientSid; sl@0: iSetFlag[KPosClientSid] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetEvaluatorId(const TUid& aUid, TComparisonOp aOp) sl@0: /** sl@0: Sets the UID of the policy evaluator DLL. sl@0: sl@0: @param aUid UID for the policy evaluator DLL sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iEvaluatorId = aUid; sl@0: iSetFlag[KPosEvaluatorId] |= KSetEvaluatorId; sl@0: iSetFlag[KPosEvaluatorId] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetServiceId(const TUid& aUid, TComparisonOp aOp) sl@0: /** sl@0: Sets the Secure ID of the service. sl@0: sl@0: @param aUid UID for the service sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iServiceId = aUid; sl@0: iSetFlag[KPosServiceId] |= KSetServiceId; sl@0: iSetFlag[KPosServiceId] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetServerSid(const TSecureId& aSid, TComparisonOp aOp) sl@0: /** sl@0: Sets the Secure ID of the system server. sl@0: sl@0: @param aUid UID for the system server sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iServerSid = aSid; sl@0: iSetFlag[KPosServerSid] |= KSetServerSid; sl@0: iSetFlag[KPosServerSid] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetFingerprintL(const TDesC8& aFingerprint, TComparisonOp aOp) sl@0: /** sl@0: Sets the fingerprint. A buffer is allocated on the heap and aFingerprint copied into it. sl@0: The function leaves, if the buffer allocation fails. sl@0: sl@0: @param aFingerprint Hash of the destination and/or opaque data. (Maximum length is 32 bytes) sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: //Fingerprint's length can not be longer than KUpsMaxFingerprintLength sl@0: if(aFingerprint.Length() > KUpsMaxFingerprintLength) sl@0: { sl@0: User::Leave(KErrUpsBadFingerprintLength); sl@0: } sl@0: sl@0: delete iFingerprint; sl@0: iFingerprint = 0; sl@0: sl@0: iFingerprint = aFingerprint.AllocL(); sl@0: iSetFlag[KPosFingerprint] |= KSetFingerprint; sl@0: iSetFlag[KPosFingerprint] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetClientEntityL(const TDesC8& aClientEntity, TComparisonOp aOp) sl@0: /** sl@0: Sets the client entity. A buffer is allocated on the heap and aClientEntity copied into it. sl@0: The function leaves, if the buffer allocation fails. sl@0: sl@0: @param aClientEntity The name of the entity within the client. (Maximum length is 32 bytes) sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: //ClientEntity's length can not be longer than KUpsMaxClientEntityLength sl@0: if(aClientEntity.Length() > KUpsMaxClientEntityLength) sl@0: { sl@0: User::Leave(KErrUpsBadClientEntityLength); sl@0: } sl@0: sl@0: delete iClientEntity; sl@0: iClientEntity = 0; sl@0: sl@0: iClientEntity = aClientEntity.AllocL(); sl@0: iSetFlag[KPosClientEntity] |= KSetClientEntity; sl@0: iSetFlag[KPosClientEntity] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetMajorPolicyVersion(const TUint16& aVersion, TComparisonOp aOp) sl@0: /** sl@0: Sets the major version of the policy file. sl@0: sl@0: @param aVersion Major policy version. sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iMajorPolicyVersion = aVersion; sl@0: iSetFlag[KPosMajorPolicyVersion] |= KSetMajorPolicyVersion; sl@0: iSetFlag[KPosMajorPolicyVersion] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetRecordId(const TUint32& aId, TComparisonOp aOp) sl@0: /** sl@0: Sets the unique Id number of the decision record which is searched. sl@0: sl@0: @param aId A unique record Id. sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iRecordId = aId; sl@0: iSetFlag[KPosRecordId] |= KSetRecordId; sl@0: iSetFlag[KPosRecordId] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetDescriptionL(const TDesC& aDescription, const TComparisonOp aOp) sl@0: /** sl@0: Sets the description field. A buffer is allocated on the heap and aDescription copied into it. sl@0: The function leaves, if the buffer allocation fails. sl@0: sl@0: @param aDescription A copy of description and/or opaque. (Maximum length is 32 bytes) sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: delete iDescription; sl@0: iDescription = 0; sl@0: sl@0: iDescription = aDescription.AllocL(); sl@0: iSetFlag[KPosDescription] |= KSetDescription; sl@0: iSetFlag[KPosDescription] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetResult(const TUint8& aResult, const TComparisonOp aOp) sl@0: /** sl@0: Sets the result field of the decision record which is searched. sl@0: sl@0: @param aResult Whether the request should be approved. sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iResult = aResult; sl@0: iSetFlag[KPosResult] |= KSetResult; sl@0: iSetFlag[KPosResult] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::SetEvaluatorInfo(const TUint32& aEvaluatorInfo, const TComparisonOp aOp) sl@0: /** sl@0: Sets the evaluator info field of the decision record which is searched. sl@0: sl@0: @param aEvaluatorInfo Policy evaluator specific data sl@0: @param aOp Comparision operator which is used to create SQL statement. sl@0: */ sl@0: { sl@0: iEvaluatorInfo = aEvaluatorInfo; sl@0: iSetFlag[KPosEvaluatorInfo] |= KSetEvaluatorInfo; sl@0: iSetFlag[KPosEvaluatorInfo] |= aOp; sl@0: } sl@0: sl@0: sl@0: EXPORT_C void CDecisionFilter::ExternalizeL(RWriteStream& aStream) const sl@0: /** sl@0: Externalise this CDecisionFilter object to the specified stream. sl@0: */ sl@0: { sl@0: aStream << iClientSid.iId; // TSecureId sl@0: aStream << iEvaluatorId.iUid; // TUid sl@0: aStream << iServiceId.iUid; // TUid sl@0: aStream << iServerSid.iId; // TSecureId sl@0: sl@0: aStream << ((iFingerprint) ? (*iFingerprint) : (KNullDesC8())); // HBufC8* sl@0: aStream << ((iClientEntity) ? (*iClientEntity) : (KNullDesC8())); // HBufC8* sl@0: sl@0: for(int i = 0; i < KFilterKeysNumber; ++i) sl@0: { sl@0: aStream.WriteUint16L(iSetFlag[i]);// TUint16 sl@0: } sl@0: sl@0: aStream << iMajorPolicyVersion;// TUint16 sl@0: aStream << iRecordId;// TUint32 sl@0: } sl@0: EXPORT_C void CDecisionFilter::InternalizeL(RReadStream& aStream) sl@0: /** sl@0: Internalise this CDecisionFilter object from the specified stream. sl@0: */ sl@0: { sl@0: iClientSid.iId= aStream.ReadUint32L(); // TSecureId sl@0: iEvaluatorId.iUid= aStream.ReadInt32L(); // TUid sl@0: iServiceId.iUid= aStream.ReadInt32L(); // TUid sl@0: iServerSid.iId= aStream.ReadUint32L(); // TSecureId sl@0: sl@0: // iFingerprint is always present in stream, so internalise it and then delete it if it is not setup. sl@0: delete iFingerprint; sl@0: iFingerprint = 0; sl@0: iFingerprint = HBufC8::NewL(aStream, KMaskDesLength8); sl@0: sl@0: // iClientEntity is always present in stream, so internalise it and then delete it if it is not setup. sl@0: delete iClientEntity; sl@0: iClientEntity = 0; sl@0: iClientEntity = HBufC8::NewL(aStream, KMaskDesLength8); sl@0: sl@0: for(int i = 0; i < KFilterKeysNumber; ++i) sl@0: { sl@0: iSetFlag[i] = aStream.ReadUint16L();// TUint16 sl@0: } sl@0: sl@0: // Delete iFingerprint if not setup sl@0: if((iSetFlag[KPosFingerprint] & KSetFingerprint) == 0) sl@0: { sl@0: delete iFingerprint; sl@0: iFingerprint = 0; sl@0: } sl@0: sl@0: // Delete iClientEntity if not setup sl@0: if((iSetFlag[KPosClientEntity] & KSetClientEntity) == 0) sl@0: { sl@0: delete iClientEntity; sl@0: iClientEntity = 0; sl@0: } sl@0: sl@0: iMajorPolicyVersion = aStream.ReadUint16L();// TUint16 sl@0: iRecordId = aStream.ReadUint32L();// TUint32 sl@0: sl@0: ValidateL(); sl@0: } sl@0: sl@0: } // End of UserPromptService namespace sl@0: // End of file