iaupdate/IAD/backgroundchecker/src/iaupdatebgfirsttimehandler.cpp
branchRCL_3
changeset 25 7333d7932ef7
parent 0 ba25891c3a9e
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    96     {
    96     {
    97     ReadDataL();
    97     ReadDataL();
    98     iAgreementAccepted = ETrue;
    98     iAgreementAccepted = ETrue;
    99     WriteDataL();
    99     WriteDataL();
   100     }
   100     }
   101     
   101        
   102 // ---------------------------------------------------------------------------
       
   103 // CIAUpdateBGFirstTimeHandler::SetAgreementAskedL
       
   104 // Set Nokia agreement as asked (prompted) to an user
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CIAUpdateBGFirstTimeHandler::SetAgreementAskedL()
       
   108     {
       
   109     ReadDataL();
       
   110     iAgreementAsked = ETrue;
       
   111     WriteDataL();
       
   112     }
       
   113         
       
   114 // ---------------------------------------------------------------------------
   102 // ---------------------------------------------------------------------------
   115 // CIAUpdateBGFirstTimeHandler::SetAutomaticUpdatesAskedL
   103 // CIAUpdateBGFirstTimeHandler::SetAutomaticUpdatesAskedL
   116 // Set automatic update checks as prompted to an use
   104 // Set automatic update checks as prompted to an use
   117 // ---------------------------------------------------------------------------
   105 // ---------------------------------------------------------------------------
   118 //
   106 //
   132     {
   120     {
   133     ReadDataL();
   121     ReadDataL();
   134     return iAgreementAccepted;
   122     return iAgreementAccepted;
   135     }
   123     }
   136 
   124 
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // CIAUpdateBGFirstTimeHandler::AgreementAskedL
       
   140 // Is Nokia agreement of Application Update already asked 
       
   141 // ---------------------------------------------------------------------------
       
   142 //
       
   143 TBool CIAUpdateBGFirstTimeHandler::AgreementAskedL()
       
   144     {
       
   145     ReadDataL();
       
   146     return iAgreementAsked;
       
   147     }
       
   148 
   125 
   149 // ---------------------------------------------------------------------------
   126 // ---------------------------------------------------------------------------
   150 // CIAUpdateBGFirstTimeHandler::AutomaticUpdateChecksAskedL
   127 // CIAUpdateBGFirstTimeHandler::AutomaticUpdateChecksAskedL
   151 // Is activation for automatic update cheks from network already asked 
   128 // Is activation for automatic update cheks from network already asked 
   152 // ---------------------------------------------------------------------------
   129 // ---------------------------------------------------------------------------
   168 	RFile file;
   145 	RFile file;
   169     TInt err = file.Open( iFsSession, iPath, EFileRead|EFileShareAny );
   146     TInt err = file.Open( iFsSession, iPath, EFileRead|EFileShareAny );
   170     if ( err == KErrNotFound )
   147     if ( err == KErrNotFound )
   171     	{
   148     	{
   172     	iAgreementAccepted = EFalse;
   149     	iAgreementAccepted = EFalse;
   173 	    iAgreementAsked = EFalse;
       
   174 	    iAutomaticUpdateChecksAsked = EFalse; 
   150 	    iAutomaticUpdateChecksAsked = EFalse; 
   175     	}
   151     	}
   176     else
   152     else
   177         {
   153         {
   178         User::LeaveIfError( err );
   154         User::LeaveIfError( err );
   214 // -----------------------------------------------------------------------------
   190 // -----------------------------------------------------------------------------
   215 //
   191 //
   216 void CIAUpdateBGFirstTimeHandler::InternalizeL( RReadStream& aStream )
   192 void CIAUpdateBGFirstTimeHandler::InternalizeL( RReadStream& aStream )
   217 	{
   193 	{
   218 	iAgreementAccepted = aStream.ReadInt32L();
   194 	iAgreementAccepted = aStream.ReadInt32L();
   219 	iAgreementAsked = aStream.ReadInt32L();
       
   220 	iAutomaticUpdateChecksAsked = aStream.ReadInt32L();
   195 	iAutomaticUpdateChecksAsked = aStream.ReadInt32L();
   221 	}
   196 	}
   222 
   197 
   223 
   198 
   224 // -----------------------------------------------------------------------------
   199 // -----------------------------------------------------------------------------
   227 // -----------------------------------------------------------------------------
   202 // -----------------------------------------------------------------------------
   228 //
   203 //
   229 void CIAUpdateBGFirstTimeHandler::ExternalizeL( RWriteStream& aStream )
   204 void CIAUpdateBGFirstTimeHandler::ExternalizeL( RWriteStream& aStream )
   230 	{
   205 	{
   231 	aStream.WriteInt32L( iAgreementAccepted );
   206 	aStream.WriteInt32L( iAgreementAccepted );
   232 	aStream.WriteInt32L( iAgreementAsked );	
       
   233 	aStream.WriteInt32L( iAutomaticUpdateChecksAsked );
   207 	aStream.WriteInt32L( iAutomaticUpdateChecksAsked );
   234 	}
   208 	}
   235     
   209     
   236 // End of File  
   210 // End of File