radioengine/utils/src/cradiosystemeventdetector.cpp
changeset 41 3a6b55c6390c
parent 28 075425b8d9a4
equal deleted inserted replaced
33:11b6825f0862 41:3a6b55c6390c
    19 #include <e32std.h> // Define before audiopolicy defs
    19 #include <e32std.h> // Define before audiopolicy defs
    20 #include <eikdef.h>
    20 #include <eikdef.h>
    21 
    21 
    22 #ifndef __WINS__
    22 #ifndef __WINS__
    23 
    23 
    24 #include <audiopolicypubsubdata.h>
    24 //#include <audiopolicypubsubdata.h>
    25 #include <audiosw_pubsubkeys.h>
    25 //#include <audiosw_pubsubkeys.h>
       
    26 #include <AudioClientsListPSKeys.h>
    26 
    27 
    27 #endif //__WINS__
    28 #endif //__WINS__
    28 
    29 
    29 #include <ctsydomainpskeys.h>
    30 #include <ctsydomainpskeys.h>
    30 #include <publicruntimeids.hrh>
    31 #include <publicruntimeids.hrh>
    34 #include "cradioenginelogger.h"
    35 #include "cradioenginelogger.h"
    35 #include "cradiosystemeventdetector.h"
    36 #include "cradiosystemeventdetector.h"
    36 #include "mradiosystemeventdetectorobserver.h"
    37 #include "mradiosystemeventdetectorobserver.h"
    37 
    38 
    38 /** Granularity for audio category arrays. */
    39 /** Granularity for audio category arrays. */
    39 const TInt KVRAudioCategoryArrayGranularity = 3;
    40 //const TInt KVRAudioCategoryArrayGranularity = 3;
    40 
    41 
    41 // This has to be the last include. 
    42 // This has to be the last include. 
    42 #ifdef STUB_CONSTELLATION
    43 #ifdef STUB_CONSTELLATION
    43 #   include "RadioStubManager.h"
    44 #   include "RadioStubManager.h"
    44 #   define KUidSystemCategory KStub_KUidSystemCategory
    45 #   define KUidSystemCategory KStub_KUidSystemCategory
    82                                                         KPSUidCtsyCallInformation,
    83                                                         KPSUidCtsyCallInformation,
    83                                                         KCTsyCallState,
    84                                                         KCTsyCallState,
    84                                                         CRadioPropertyObserver::ERadioPropertyInt );
    85                                                         CRadioPropertyObserver::ERadioPropertyInt );
    85     iCallStatusObserver->ActivateL();
    86     iCallStatusObserver->ActivateL();
    86     iIsCallActive = iCallStatusObserver->ValueInt() != EPSCTsyCallStateNone;
    87     iIsCallActive = iCallStatusObserver->ValueInt() != EPSCTsyCallStateNone;
    87 
    88 /*
    88 #ifndef __WINS__
    89 #ifndef __WINS__
    89     // Define audio types for not resuming.
    90     // Define audio types for not resuming.
       
    91     //TODO: Check these audio resume categories!
    90     iNoAutoResumeAudioCategories = RArray<TInt>( KVRAudioCategoryArrayGranularity );
    92     iNoAutoResumeAudioCategories = RArray<TInt>( KVRAudioCategoryArrayGranularity );
    91     iNoAutoResumeAudioCategories.AppendL( ECatMediaPlayer );
    93     iNoAutoResumeAudioCategories.AppendL( ECatMediaPlayer );
    92     iNoAutoResumeAudioCategories.AppendL( ECatMobileTv );
    94     iNoAutoResumeAudioCategories.AppendL( ECatMobileTv );
    93     iNoAutoResumeAudioCategories.AppendL( ECatUnknownPlayer );
    95     iNoAutoResumeAudioCategories.AppendL( ECatUnknownPlayer );
    94     iNoAutoResumeAudioCategories.Compress();
    96     iNoAutoResumeAudioCategories.Compress();
    95     // Start listening audio client events.
    97     // Start listening audio client events.
    96     iAudioPolicyObserver = CRadioPropertyObserver::NewL( *this, KPSUidMMFAudioServer, KAudioPolicyAudioClients, CRadioPropertyObserver::ERadioPropertyByteArray );
    98     iAudioPolicyObserver = CRadioPropertyObserver::NewL( *this, KPSUidMMFAudioServer, KAudioPolicyAudioClients, CRadioPropertyObserver::ERadioPropertyByteArray );
    97     iAudioPolicyObserver->ActivateL();
    99     iAudioPolicyObserver->ActivateL();
    98 #endif
   100 #endif
       
   101 */
    99     }
   102     }
   100 
   103 
   101 // ---------------------------------------------------------------------------
   104 // ---------------------------------------------------------------------------
   102 //
   105 //
   103 // ---------------------------------------------------------------------------
   106 // ---------------------------------------------------------------------------
   174             TBool atLeastOneNoAutoResumeAudioPlaying( EFalse );
   177             TBool atLeastOneNoAutoResumeAudioPlaying( EFalse );
   175             TBool radioPlaying( EFalse );
   178             TBool radioPlaying( EFalse );
   176             TAudioClientList audioClients;
   179             TAudioClientList audioClients;
   177             audioClients.Copy( aValue );
   180             audioClients.Copy( aValue );
   178             // Check all playing audios!
   181             // Check all playing audios!
   179             for ( TInt i = 0; i < audioClients().iNumOfProcesses ; i++ )
   182             for ( TInt i = 0; i < audioClients().iNumOfProcesses ; ++i )
   180                 {
   183                 {
   181                 TInt cat = audioClients().iClientCategoryList[i];
   184                 TInt cat = audioClients().iClientCategoryList[i];
   182                 LOG_FORMAT( "Check audio cat %x", cat );
   185                 LOG_FORMAT( "Check audio cat %x", cat );
   183                 if ( cat == ECatFmRadio )
   186                 if ( cat == ECatFmRadio )
   184                     {
   187                     {