iaupdate/IAD/backgroundchecker/src/iaupdatebgfirsttimehandler.cpp
branchRCL_3
changeset 26 8b7f4e561641
parent 25 7333d7932ef7
equal deleted inserted replaced
25:7333d7932ef7 26:8b7f4e561641
     1 /*
     1 /*
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008 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         
   102 // ---------------------------------------------------------------------------
   114 // ---------------------------------------------------------------------------
   103 // CIAUpdateBGFirstTimeHandler::SetAutomaticUpdatesAskedL
   115 // CIAUpdateBGFirstTimeHandler::SetAutomaticUpdatesAskedL
   104 // Set automatic update checks as prompted to an use
   116 // Set automatic update checks as prompted to an use
   105 // ---------------------------------------------------------------------------
   117 // ---------------------------------------------------------------------------
   106 //
   118 //
   120     {
   132     {
   121     ReadDataL();
   133     ReadDataL();
   122     return iAgreementAccepted;
   134     return iAgreementAccepted;
   123     }
   135     }
   124 
   136 
       
   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     }
   125 
   148 
   126 // ---------------------------------------------------------------------------
   149 // ---------------------------------------------------------------------------
   127 // CIAUpdateBGFirstTimeHandler::AutomaticUpdateChecksAskedL
   150 // CIAUpdateBGFirstTimeHandler::AutomaticUpdateChecksAskedL
   128 // Is activation for automatic update cheks from network already asked 
   151 // Is activation for automatic update cheks from network already asked 
   129 // ---------------------------------------------------------------------------
   152 // ---------------------------------------------------------------------------
   145 	RFile file;
   168 	RFile file;
   146     TInt err = file.Open( iFsSession, iPath, EFileRead|EFileShareAny );
   169     TInt err = file.Open( iFsSession, iPath, EFileRead|EFileShareAny );
   147     if ( err == KErrNotFound )
   170     if ( err == KErrNotFound )
   148     	{
   171     	{
   149     	iAgreementAccepted = EFalse;
   172     	iAgreementAccepted = EFalse;
       
   173 	    iAgreementAsked = EFalse;
   150 	    iAutomaticUpdateChecksAsked = EFalse; 
   174 	    iAutomaticUpdateChecksAsked = EFalse; 
   151     	}
   175     	}
   152     else
   176     else
   153         {
   177         {
   154         User::LeaveIfError( err );
   178         User::LeaveIfError( err );
   190 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   191 //
   215 //
   192 void CIAUpdateBGFirstTimeHandler::InternalizeL( RReadStream& aStream )
   216 void CIAUpdateBGFirstTimeHandler::InternalizeL( RReadStream& aStream )
   193 	{
   217 	{
   194 	iAgreementAccepted = aStream.ReadInt32L();
   218 	iAgreementAccepted = aStream.ReadInt32L();
       
   219 	iAgreementAsked = aStream.ReadInt32L();
   195 	iAutomaticUpdateChecksAsked = aStream.ReadInt32L();
   220 	iAutomaticUpdateChecksAsked = aStream.ReadInt32L();
   196 	}
   221 	}
   197 
   222 
   198 
   223 
   199 // -----------------------------------------------------------------------------
   224 // -----------------------------------------------------------------------------
   202 // -----------------------------------------------------------------------------
   227 // -----------------------------------------------------------------------------
   203 //
   228 //
   204 void CIAUpdateBGFirstTimeHandler::ExternalizeL( RWriteStream& aStream )
   229 void CIAUpdateBGFirstTimeHandler::ExternalizeL( RWriteStream& aStream )
   205 	{
   230 	{
   206 	aStream.WriteInt32L( iAgreementAccepted );
   231 	aStream.WriteInt32L( iAgreementAccepted );
       
   232 	aStream.WriteInt32L( iAgreementAsked );	
   207 	aStream.WriteInt32L( iAutomaticUpdateChecksAsked );
   233 	aStream.WriteInt32L( iAutomaticUpdateChecksAsked );
   208 	}
   234 	}
   209     
   235     
   210 // End of File  
   236 // End of File