mmfenh/profilesettingsmonitor/src/ProfileSettingsMonitorServerImpl.cpp
author hgs
Tue, 24 Aug 2010 03:16:41 -0500
changeset 43 9894ed580e4a
parent 38 9e9fc5ab059f
permissions -rw-r--r--
201033
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
*
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
*
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
* Contributors:
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
* Description:  This file contains implementation of 
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
                    ProfileSettingsMonitorServerImpl.
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
*
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
*/
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
#include "ProfileSettingsMonitorServerImpl.h"
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <AudioClientsListPSKeys.h>
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#include <AudioClientsListPSData.h>
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#include <MediaStreamPropertiesPSKeys.h>
43
hgs
parents: 38
diff changeset
    24
#include <MProfileExtended.h>
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#ifdef _DEBUG
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
#define DEB_TRACE0(str)             RDebug::Print(str)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#define DEB_TRACE1(str, val1)       RDebug::Print(str, val1)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#else
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#define DEB_TRACE0(str)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#define DEB_TRACE1(str, val1)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
#endif // _DEBUG
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
static _LIT_SECURITY_POLICY_PASS(KClientStateReadPolicy);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
static _LIT_SECURITY_POLICY_S0(KMMFAudioServerSIDPolicy, KUidMmfAudioServerDllUnicodeDefine);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
CProfileSettingsMonitorServerImpl::CProfileSettingsMonitorServerImpl()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
CProfileSettingsMonitorServerImpl::~CProfileSettingsMonitorServerImpl()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
	iWarningTonesProperty.Close();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
	RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASWarningTones);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
	
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
	iMessagingTonesProperty.Close();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
	RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASMessageTones);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
	
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
	iSilentProfileProperty.Close();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
	RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASSilentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
	
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
	iVibraProperty.Close();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    55
	RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASVibra);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    56
	
38
hgs
parents: 0
diff changeset
    57
	iRingingTypeProperty.Close();
hgs
parents: 0
diff changeset
    58
	RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingType);
hgs
parents: 0
diff changeset
    59
	
hgs
parents: 0
diff changeset
    60
	iMessageToneNameProperty.Close();
hgs
parents: 0
diff changeset
    61
	RProperty::Delete(KGASPSUidGlobalAudioSettings, KGASMessageToneName);
hgs
parents: 0
diff changeset
    62
	
hgs
parents: 0
diff changeset
    63
	iEmailToneNameProperty.Close();
hgs
parents: 0
diff changeset
    64
	RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASEmailToneName);
hgs
parents: 0
diff changeset
    65
	
hgs
parents: 0
diff changeset
    66
	iVideoCallToneNameProperty.Close();
hgs
parents: 0
diff changeset
    67
	RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASVideoCallToneName);
hgs
parents: 0
diff changeset
    68
	
hgs
parents: 0
diff changeset
    69
	iRingingTone1NameProperty.Close();
hgs
parents: 0
diff changeset
    70
	RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingTone1Name);
hgs
parents: 0
diff changeset
    71
	
hgs
parents: 0
diff changeset
    72
	iRingingTone2NameProperty.Close();
hgs
parents: 0
diff changeset
    73
    RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASRingingTone2Name);
hgs
parents: 0
diff changeset
    74
	
hgs
parents: 0
diff changeset
    75
	iKeypadVolumeProperty.Close();
hgs
parents: 0
diff changeset
    76
	RProperty::Delete(KGASPSUidGlobalAudioSettings,KGASKeypadToneVolume);
hgs
parents: 0
diff changeset
    77
	
hgs
parents: 0
diff changeset
    78
	if(iMessageToneName)
hgs
parents: 0
diff changeset
    79
	  {
hgs
parents: 0
diff changeset
    80
	  delete iMessageToneName;
hgs
parents: 0
diff changeset
    81
	  iMessageToneName=NULL;
hgs
parents: 0
diff changeset
    82
	  }
hgs
parents: 0
diff changeset
    83
	if(iEmailToneName)
hgs
parents: 0
diff changeset
    84
	  {
hgs
parents: 0
diff changeset
    85
	  delete iEmailToneName;
hgs
parents: 0
diff changeset
    86
	  iEmailToneName=NULL;
hgs
parents: 0
diff changeset
    87
	  }
hgs
parents: 0
diff changeset
    88
	if(iVideoCallToneName)
hgs
parents: 0
diff changeset
    89
	  {
hgs
parents: 0
diff changeset
    90
	  delete iVideoCallToneName;
hgs
parents: 0
diff changeset
    91
	  iVideoCallToneName=NULL;
hgs
parents: 0
diff changeset
    92
	  }
hgs
parents: 0
diff changeset
    93
	if(iRingingTone1Name)
hgs
parents: 0
diff changeset
    94
	  {
hgs
parents: 0
diff changeset
    95
	  delete iRingingTone1Name;
hgs
parents: 0
diff changeset
    96
	  iRingingTone1Name=NULL;
hgs
parents: 0
diff changeset
    97
	  }
hgs
parents: 0
diff changeset
    98
	if(iRingingTone2Name)
hgs
parents: 0
diff changeset
    99
	   {
hgs
parents: 0
diff changeset
   100
	   delete iRingingTone2Name;
hgs
parents: 0
diff changeset
   101
	   iRingingTone2Name=NULL;
hgs
parents: 0
diff changeset
   102
	   }
43
hgs
parents: 38
diff changeset
   103
	if(iProfileEngineExtended)
hgs
parents: 38
diff changeset
   104
	    {
hgs
parents: 38
diff changeset
   105
	    iProfileEngineExtended->Release();
hgs
parents: 38
diff changeset
   106
	    }
hgs
parents: 38
diff changeset
   107
	//delete iProfileEngineExtended;
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   108
	// Release profile engine resources
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   109
	if ( iEngine )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   110
	    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   111
	    iEngine->Release();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   112
	    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   113
	delete iEngine;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   114
	delete iNotifyHandler;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   115
	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   116
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   117
CProfileSettingsMonitorServerImpl* CProfileSettingsMonitorServerImpl::NewL()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   118
	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   119
	CProfileSettingsMonitorServerImpl* s = new(ELeave) CProfileSettingsMonitorServerImpl();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   120
	CleanupStack::PushL(s);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   121
	s->ConstructL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   122
	CleanupStack::Pop();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   123
	return s;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   124
	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   125
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   126
void CProfileSettingsMonitorServerImpl::ConstructL()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   127
	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   128
    iEngine = ProEngFactory::NewEngineL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   129
    iNotifyHandler = ProEngFactory::NewNotifyHandlerL();    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   130
    User::LeaveIfError( iNotifyHandler->RequestProfileActivationNotificationsL( *this ));    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   131
    User::LeaveIfError( iNotifyHandler->RequestActiveProfileNotificationsL( *this ));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   132
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   133
    // Initialize iSilentProfile
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   134
    iActiveProfileId = iEngine->ActiveProfileId();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   135
    if(iActiveProfileId == 1) 
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   136
        iSilentProfile = ETrue;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   137
    else
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   138
        iSilentProfile = EFalse;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   139
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   140
    // Initialize iWarningTones, iMessagingTones and iVibra
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   141
    MProEngProfile* currentProfile = iEngine->ActiveProfileL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   142
    //CleanupStack::PushL(currentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   143
    MProEngToneSettings& settings = currentProfile->ToneSettings();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   144
    iWarningTones = settings.WarningAndGameTones();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   145
    iMessagingTones = !( currentProfile->IsSilent() );
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   146
    iVibra = settings.VibratingAlert();
38
hgs
parents: 0
diff changeset
   147
  
hgs
parents: 0
diff changeset
   148
    CMapGASRingingType( settings.RingingType());
hgs
parents: 0
diff changeset
   149
    
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   150
    //CleanupStack::PopAndDestroy(currentProfile);
38
hgs
parents: 0
diff changeset
   151
   
hgs
parents: 0
diff changeset
   152
    MProEngTones& profileTones=currentProfile->ProfileTones();
hgs
parents: 0
diff changeset
   153
    
hgs
parents: 0
diff changeset
   154
    iMessageToneName=profileTones.MessageAlertTone().AllocL();
hgs
parents: 0
diff changeset
   155
   
hgs
parents: 0
diff changeset
   156
    iEmailToneName=profileTones.EmailAlertTone().AllocL();
hgs
parents: 0
diff changeset
   157
    
hgs
parents: 0
diff changeset
   158
    iVideoCallToneName=profileTones.VideoCallRingingTone().AllocL();
hgs
parents: 0
diff changeset
   159
    
hgs
parents: 0
diff changeset
   160
    iRingingTone1Name=profileTones.RingingTone1().AllocL();
hgs
parents: 0
diff changeset
   161
    
hgs
parents: 0
diff changeset
   162
    iRingingTone2Name=profileTones.RingingTone2().AllocL();
hgs
parents: 0
diff changeset
   163
        
hgs
parents: 0
diff changeset
   164
  
hgs
parents: 0
diff changeset
   165
    CMapGASKeypadVolume(settings.KeypadVolume());
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   166
    
43
hgs
parents: 38
diff changeset
   167
    iProfileEngineExtended =::CreateProfileEngineExtended2L();
hgs
parents: 38
diff changeset
   168
   
hgs
parents: 38
diff changeset
   169
     iSilenceMode = iProfileEngineExtended->SilenceModeL();
hgs
parents: 38
diff changeset
   170
     RDebug::Printf("value of silence mode %d",iSilenceMode);
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   171
    // Get PublicSilence from CenRep
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   172
    TInt featureBitmask( 0 );     
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   173
    CRepository* profileCenRep = CRepository::NewL( KCRUidProfilesLV );
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   174
    CleanupStack::PushL(profileCenRep);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   175
    User::LeaveIfError( profileCenRep->Get( KProfilesLVFlags, featureBitmask ) );
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   176
    if  ( featureBitmask & KProEngFeatureIdForceSilentMode )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   177
        iPublicSilence = ETrue;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   178
    else
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   179
        iPublicSilence = EFalse;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   180
    CleanupStack::PopAndDestroy(profileCenRep);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   181
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   182
    TSecurityPolicy read = TSecurityPolicy(ECapabilityWriteDeviceData);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   183
    TSecurityPolicy write = TSecurityPolicy(ECapabilityMultimediaDD);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   184
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   185
    // Define and Initialize Warning Tones PnS key
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   186
    User::LeaveIfError(RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   187
                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   188
                                    KGASWarningTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   189
                                    RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   190
                                    read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   191
                                    write));	    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   192
    User::LeaveIfError(iWarningTonesProperty.Attach(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   193
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   194
                                                KGASWarningTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   195
    User::LeaveIfError(iWarningTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   196
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   197
                                                KGASWarningTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   198
                                                iWarningTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   199
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   200
    // Define and Initialize Messaging Tones PnS key
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   201
    User::LeaveIfError(RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   202
                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   203
                                    KGASMessageTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   204
                                    RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   205
                                    read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   206
                                    write));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   207
    User::LeaveIfError(iMessagingTonesProperty.Attach(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   208
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   209
                                                KGASMessageTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   210
    User::LeaveIfError(iMessagingTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   211
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   212
                                                KGASMessageTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   213
                                                iMessagingTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   214
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   215
    // Define and Initialize Silent Profile PnS key
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   216
     User::LeaveIfError(RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   217
                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   218
                                    KGASSilentProfile,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   219
                                    RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   220
                                    read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   221
                                    write));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   222
    User::LeaveIfError(iSilentProfileProperty.Attach(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   223
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   224
                                                KGASSilentProfile));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   225
    User::LeaveIfError(iSilentProfileProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   226
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   227
                                                KGASSilentProfile,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   228
                                                iSilentProfile));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   229
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   230
    // Define and Initialize Vibra PnS key
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   231
    User::LeaveIfError(RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   232
                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   233
                                    KGASVibra,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   234
                                    RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   235
                                    read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   236
                                    write));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   237
    User::LeaveIfError(iVibraProperty.Attach(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   238
                                        KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   239
                                        KGASVibra));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   240
    User::LeaveIfError(iVibraProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   241
                                        KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   242
                                        KGASVibra,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   243
                                        iVibra));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   244
                        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   245
    // Define and Initialize Public Silence PnS key
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   246
    User::LeaveIfError(RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   247
                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   248
                                    KGASPublicSilence,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   249
                                    RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   250
                                    read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   251
                                    write));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   252
    User::LeaveIfError(iPublicSilenceProperty.Attach(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   253
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   254
                                                KGASPublicSilence));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   255
    User::LeaveIfError(iPublicSilenceProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   256
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   257
                                                KGASPublicSilence,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   258
                                                iPublicSilence));
38
hgs
parents: 0
diff changeset
   259
    
hgs
parents: 0
diff changeset
   260
    
hgs
parents: 0
diff changeset
   261
    
hgs
parents: 0
diff changeset
   262
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   263
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   264
                                    KGASRingingType,
hgs
parents: 0
diff changeset
   265
                                    RProperty::EInt,
hgs
parents: 0
diff changeset
   266
                                    read,
hgs
parents: 0
diff changeset
   267
                                    write));
hgs
parents: 0
diff changeset
   268
    User::LeaveIfError(iRingingTypeProperty.Attach(
hgs
parents: 0
diff changeset
   269
                                              KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   270
                                              KGASRingingType));
hgs
parents: 0
diff changeset
   271
    User::LeaveIfError(iRingingTypeProperty.Set(
hgs
parents: 0
diff changeset
   272
                                              KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   273
                                              KGASRingingType,
hgs
parents: 0
diff changeset
   274
                                              iGASRingingType));
hgs
parents: 0
diff changeset
   275
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   276
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   277
                                    KGASMessageToneName,
hgs
parents: 0
diff changeset
   278
                                    RProperty::EText,
hgs
parents: 0
diff changeset
   279
                                    read,
hgs
parents: 0
diff changeset
   280
                                    write));
hgs
parents: 0
diff changeset
   281
    User::LeaveIfError(iMessageToneNameProperty.Attach(
hgs
parents: 0
diff changeset
   282
                                                KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   283
                                                KGASMessageToneName));
hgs
parents: 0
diff changeset
   284
    User::LeaveIfError(iMessageToneNameProperty.Set(
hgs
parents: 0
diff changeset
   285
                                                KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   286
                                                KGASMessageToneName,
hgs
parents: 0
diff changeset
   287
                                                *iMessageToneName));
hgs
parents: 0
diff changeset
   288
    
hgs
parents: 0
diff changeset
   289
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   290
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   291
                                    KGASEmailToneName,
hgs
parents: 0
diff changeset
   292
                                    RProperty::EText,
hgs
parents: 0
diff changeset
   293
                                    read,
hgs
parents: 0
diff changeset
   294
                                    write));
hgs
parents: 0
diff changeset
   295
    User::LeaveIfError(iEmailToneNameProperty.Attach(
hgs
parents: 0
diff changeset
   296
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   297
                                               KGASEmailToneName));
hgs
parents: 0
diff changeset
   298
    User::LeaveIfError(iEmailToneNameProperty.Set(
hgs
parents: 0
diff changeset
   299
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   300
                                               KGASEmailToneName,
hgs
parents: 0
diff changeset
   301
                                               *iEmailToneName));
hgs
parents: 0
diff changeset
   302
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   303
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   304
                                    KGASVideoCallToneName,
hgs
parents: 0
diff changeset
   305
                                    RProperty::EText,
hgs
parents: 0
diff changeset
   306
                                    read,
hgs
parents: 0
diff changeset
   307
                                    write));
hgs
parents: 0
diff changeset
   308
    User::LeaveIfError(iVideoCallToneNameProperty.Attach(
hgs
parents: 0
diff changeset
   309
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   310
                                               KGASVideoCallToneName));
hgs
parents: 0
diff changeset
   311
    User::LeaveIfError(iVideoCallToneNameProperty.Set(
hgs
parents: 0
diff changeset
   312
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   313
                                               KGASVideoCallToneName,
hgs
parents: 0
diff changeset
   314
                                               *iVideoCallToneName));
hgs
parents: 0
diff changeset
   315
        
hgs
parents: 0
diff changeset
   316
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   317
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   318
                                    KGASRingingTone1Name,
hgs
parents: 0
diff changeset
   319
                                    RProperty::EText,
hgs
parents: 0
diff changeset
   320
                                    read,
hgs
parents: 0
diff changeset
   321
                                    write));
hgs
parents: 0
diff changeset
   322
    User::LeaveIfError(iRingingTone1NameProperty.Attach(
hgs
parents: 0
diff changeset
   323
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   324
                                               KGASRingingTone1Name));
hgs
parents: 0
diff changeset
   325
    User::LeaveIfError(iRingingTone1NameProperty.Set(
hgs
parents: 0
diff changeset
   326
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   327
                                               KGASRingingTone1Name,
hgs
parents: 0
diff changeset
   328
                                               *iRingingTone1Name));
hgs
parents: 0
diff changeset
   329
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   330
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   331
                                    KGASRingingTone2Name,
hgs
parents: 0
diff changeset
   332
                                    RProperty::EText,
hgs
parents: 0
diff changeset
   333
                                    read,
hgs
parents: 0
diff changeset
   334
                                    write));
hgs
parents: 0
diff changeset
   335
    User::LeaveIfError(iRingingTone2NameProperty.Attach(
hgs
parents: 0
diff changeset
   336
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   337
                                               KGASRingingTone2Name));
hgs
parents: 0
diff changeset
   338
    User::LeaveIfError(iRingingTone2NameProperty.Set(
hgs
parents: 0
diff changeset
   339
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   340
                                               KGASRingingTone2Name,
hgs
parents: 0
diff changeset
   341
                                               *iRingingTone2Name));
hgs
parents: 0
diff changeset
   342
    
hgs
parents: 0
diff changeset
   343
    User::LeaveIfError(RProperty::Define(
hgs
parents: 0
diff changeset
   344
                                    KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   345
                                    KGASKeypadToneVolume,
hgs
parents: 0
diff changeset
   346
                                    RProperty::EInt,
hgs
parents: 0
diff changeset
   347
                                    read,
hgs
parents: 0
diff changeset
   348
                                    write));
hgs
parents: 0
diff changeset
   349
    User::LeaveIfError(iKeypadVolumeProperty.Attach(
hgs
parents: 0
diff changeset
   350
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   351
                                               KGASKeypadToneVolume));
hgs
parents: 0
diff changeset
   352
    User::LeaveIfError(iKeypadVolumeProperty.Set(
hgs
parents: 0
diff changeset
   353
                                               KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   354
                                               KGASKeypadToneVolume,
hgs
parents: 0
diff changeset
   355
                                               iGASKeypadVolume));
43
hgs
parents: 38
diff changeset
   356
    
hgs
parents: 38
diff changeset
   357
    User::LeaveIfError(RProperty::Define(
hgs
parents: 38
diff changeset
   358
                                        KGASPSUidGlobalAudioSettings,
hgs
parents: 38
diff changeset
   359
                                        KGASSilenceMode,
hgs
parents: 38
diff changeset
   360
                                        RProperty::EInt,
hgs
parents: 38
diff changeset
   361
                                        read,
hgs
parents: 38
diff changeset
   362
                                        write));
hgs
parents: 38
diff changeset
   363
        User::LeaveIfError(iSilenceModeProperty.Attach(
hgs
parents: 38
diff changeset
   364
                                                   KGASPSUidGlobalAudioSettings,
hgs
parents: 38
diff changeset
   365
                                                   KGASSilenceMode));
hgs
parents: 38
diff changeset
   366
        User::LeaveIfError(iSilenceModeProperty.Set(
hgs
parents: 38
diff changeset
   367
                                                   KGASPSUidGlobalAudioSettings,
hgs
parents: 38
diff changeset
   368
                                                   KGASSilenceMode,
hgs
parents: 38
diff changeset
   369
                                                   iSilenceMode));
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   370
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   371
    //Stream Gain Control
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   372
    TInt status = RProperty::Define(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   373
                                KPSUidMediaStreamProperties,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   374
                                KMediaStreamCurrentGain,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   375
                                RProperty::EInt,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   376
                                read,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   377
                                write);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   378
    if ( status != KErrAlreadyExists )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   379
	    User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   380
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   381
    // Audio Clients List
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   382
    InitializeAudioClientsListPSKeysL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   383
    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   384
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   385
void CProfileSettingsMonitorServerImpl::InitializeAudioClientsListPSKeysL()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   386
    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   387
    DEB_TRACE0(_L("CProfileSettingsMonitorServerImpl::InitializeAudioClientsListPSKeysL:Enter"));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   388
	// define KAudioPolicyApplicationAudioStatePlaying property to be a byte array
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   389
	TInt status = RProperty::Define(KPSUidMMFAudioServer,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   390
	                                KAudioPolicyApplicationAudioStatePlaying,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   391
	                                RProperty::EByteArray,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   392
		                            KClientStateReadPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   393
		                            KMMFAudioServerSIDPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   394
		                            sizeof(struct TAudioPolicyProcessIdListStruct));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   395
	DEB_TRACE1(_L("Define KAudioPolicyApplicationAudioStatePlaying returns %d"), status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   396
	if (status != KErrAlreadyExists)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   397
	    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   398
	    User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   399
	    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   400
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   401
	// define KAudioPolicyApplicationAudioStateRecording property to be a byte array
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   402
	status = RProperty::Define(KPSUidMMFAudioServer,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   403
	                           KAudioPolicyApplicationAudioStateRecording,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   404
	                           RProperty::EByteArray,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   405
	                           KClientStateReadPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   406
	                           KMMFAudioServerSIDPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   407
	                           sizeof(struct TAudioPolicyProcessIdListStruct));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   408
	DEB_TRACE1(_L("Define KAudioPolicyApplicationAudioStateRecording returns %d"), status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   409
	if (status != KErrAlreadyExists)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   410
	    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   411
	    User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   412
	    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   413
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   414
	// define KAudioPolicyApplicationAudioStatePaused property to be a byte array
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   415
	status = RProperty::Define(KPSUidMMFAudioServer,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   416
	                           KAudioPolicyApplicationAudioStatePaused,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   417
	                           RProperty::EByteArray,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   418
	                           KClientStateReadPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   419
	                           KMMFAudioServerSIDPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   420
	                           sizeof(struct TAudioPolicyProcessIdListStruct));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   421
	DEB_TRACE1(_L("Define KAudioPolicyApplicationAudioStatePaused returns %d"), status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   422
	if (status != KErrAlreadyExists)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   423
    	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   424
    	User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   425
    	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   426
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   427
	// define KAudioPolicyForceMutedClients property to be a byte array
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   428
	status = RProperty::Define(KPSUidMMFAudioServer,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   429
	                           KAudioPolicyForceMutedClients,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   430
	                           RProperty::EByteArray,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   431
	                           KClientStateReadPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   432
	                           KMMFAudioServerSIDPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   433
	                           sizeof(struct TAudioPolicyProcessIdListStruct));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   434
	DEB_TRACE1(_L("Define KAudioPolicyForceMutedClients returns %d"), status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   435
	if (status != KErrAlreadyExists)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   436
    	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   437
    	User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   438
    	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   439
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   440
	// define KAudioPolicyAudioClients property to be a byte array
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   441
	status = RProperty::Define(KPSUidMMFAudioServer,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   442
	                           KAudioPolicyAudioClients,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   443
	                           RProperty::EByteArray,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   444
	                           KClientStateReadPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   445
	                           KMMFAudioServerSIDPolicy,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   446
	                           sizeof(struct TAudioClientListStruct));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   447
	DEB_TRACE1(_L("Define KAudioPolicyAudioClients returns %d"), status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   448
	if (status != KErrAlreadyExists)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   449
    	{
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   450
    	User::LeaveIfError(status);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   451
    	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   452
    DEB_TRACE0(_L("CProfileSettingsMonitorServerImpl::InitializeAudioClientsListPSKeysL:Exit"));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   453
    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   454
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   455
void CProfileSettingsMonitorServerImpl::HandleProfileActivatedL( TInt aProfileId )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   456
    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   457
    DEB_TRACE1(_L("CProfileSettingsMonitorServerImpl::HandleProfileActivatedL[%d]"), aProfileId);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   458
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   459
    if ( iActiveProfileId != aProfileId )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   460
        {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   461
        MProEngProfile* currentProfile = iEngine->ActiveProfileL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   462
        CleanupReleasePushL(*currentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   463
        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   464
        TBool silentProfile;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   465
        iActiveProfileId = aProfileId;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   466
        //iActiveProfileId = iEngine->ActiveProfileId();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   467
        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   468
        if(iActiveProfileId == 1) // Silent profile is always '1'
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   469
            silentProfile = ETrue;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   470
        else
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   471
            silentProfile = EFalse;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   472
        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   473
        if(silentProfile != iSilentProfile)
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   474
            {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   475
            iSilentProfile = silentProfile;
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   476
            User::LeaveIfError(iSilentProfileProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   477
                                                        KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   478
                                                        KGASSilentProfile,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   479
                                                        iSilentProfile));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   480
            }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   481
            
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   482
        MProEngToneSettings& settings = currentProfile->ToneSettings();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   483
        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   484
        if(iWarningTones != settings.WarningAndGameTones())
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   485
            {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   486
            iWarningTones = settings.WarningAndGameTones();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   487
            User::LeaveIfError(iWarningTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   488
                                                        KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   489
                                                        KGASWarningTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   490
                                                        iWarningTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   491
            }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   492
        
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   493
        if(iMessagingTones != (!( currentProfile->IsSilent() )))
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   494
            {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   495
            iMessagingTones = !( currentProfile->IsSilent() );
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   496
            User::LeaveIfError(iMessagingTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   497
                                                        KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   498
                                                        KGASMessageTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   499
                                                        iMessagingTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   500
            }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   501
        if(iVibra != settings.VibratingAlert())
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   502
            {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   503
            iVibra = settings.VibratingAlert();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   504
            User::LeaveIfError(iVibraProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   505
                                                KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   506
                                                KGASVibra,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   507
                                                iVibra));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   508
            }
38
hgs
parents: 0
diff changeset
   509
        if(iGASRingingType != settings.RingingType())
hgs
parents: 0
diff changeset
   510
            {
hgs
parents: 0
diff changeset
   511
            
hgs
parents: 0
diff changeset
   512
             CMapGASRingingType(settings.RingingType());
hgs
parents: 0
diff changeset
   513
            
hgs
parents: 0
diff changeset
   514
             User::LeaveIfError(iRingingTypeProperty.Set(
hgs
parents: 0
diff changeset
   515
                                                         KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   516
                                                         KGASRingingType,
hgs
parents: 0
diff changeset
   517
                                                         iGASRingingType));
hgs
parents: 0
diff changeset
   518
             
hgs
parents: 0
diff changeset
   519
            }
hgs
parents: 0
diff changeset
   520
        MProEngTones &profileTones=currentProfile->ProfileTones();
hgs
parents: 0
diff changeset
   521
        if(iMessageToneName->Compare(profileTones.MessageAlertTone())!= 0)
hgs
parents: 0
diff changeset
   522
            {
hgs
parents: 0
diff changeset
   523
              delete iMessageToneName;
hgs
parents: 0
diff changeset
   524
              iMessageToneName=NULL;
hgs
parents: 0
diff changeset
   525
              iMessageToneName=profileTones.MessageAlertTone().AllocL();
hgs
parents: 0
diff changeset
   526
              User::LeaveIfError(iMessageToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   527
                                                              KGASMessageToneName,
hgs
parents: 0
diff changeset
   528
                                                              *iMessageToneName));
hgs
parents: 0
diff changeset
   529
            }
hgs
parents: 0
diff changeset
   530
        if(iEmailToneName->Compare(profileTones.EmailAlertTone())!= 0)
hgs
parents: 0
diff changeset
   531
            {
hgs
parents: 0
diff changeset
   532
              delete iEmailToneName;
hgs
parents: 0
diff changeset
   533
              iEmailToneName=NULL;
hgs
parents: 0
diff changeset
   534
              iEmailToneName=profileTones.EmailAlertTone().AllocL();
hgs
parents: 0
diff changeset
   535
              User::LeaveIfError(iEmailToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   536
                                                                            KGASEmailToneName,
hgs
parents: 0
diff changeset
   537
                                                                            *iEmailToneName));
hgs
parents: 0
diff changeset
   538
            }
hgs
parents: 0
diff changeset
   539
        if(iVideoCallToneName->Compare(profileTones.VideoCallRingingTone())!=0)
hgs
parents: 0
diff changeset
   540
            {
hgs
parents: 0
diff changeset
   541
              delete iVideoCallToneName;
hgs
parents: 0
diff changeset
   542
              iVideoCallToneName=NULL;
hgs
parents: 0
diff changeset
   543
              iVideoCallToneName=profileTones.VideoCallRingingTone().AllocL();
hgs
parents: 0
diff changeset
   544
              User::LeaveIfError(iVideoCallToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   545
                                                                                          KGASVideoCallToneName,
hgs
parents: 0
diff changeset
   546
                                                                                          *iVideoCallToneName));
hgs
parents: 0
diff changeset
   547
              
hgs
parents: 0
diff changeset
   548
            }
hgs
parents: 0
diff changeset
   549
        if(iRingingTone1Name->Compare(profileTones.RingingTone1())!=0)
hgs
parents: 0
diff changeset
   550
            {
hgs
parents: 0
diff changeset
   551
          delete iRingingTone1Name;
hgs
parents: 0
diff changeset
   552
          iRingingTone1Name=NULL;
hgs
parents: 0
diff changeset
   553
          iRingingTone1Name=profileTones.RingingTone1().AllocL();
hgs
parents: 0
diff changeset
   554
          User::LeaveIfError(iRingingTone1NameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   555
                                                                                      KGASRingingTone1Name,
hgs
parents: 0
diff changeset
   556
                                                                                      *iRingingTone1Name));
hgs
parents: 0
diff changeset
   557
            }
hgs
parents: 0
diff changeset
   558
        if(iRingingTone2Name->Compare(profileTones.RingingTone2())!=0)
hgs
parents: 0
diff changeset
   559
                    {
hgs
parents: 0
diff changeset
   560
                   delete iRingingTone2Name;
hgs
parents: 0
diff changeset
   561
                  iRingingTone2Name=NULL;
hgs
parents: 0
diff changeset
   562
                  iRingingTone2Name=profileTones.RingingTone2().AllocL();
hgs
parents: 0
diff changeset
   563
                  User::LeaveIfError(iRingingTone2NameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   564
                                                                                              KGASRingingTone2Name,
hgs
parents: 0
diff changeset
   565
                                                                                              *iRingingTone2Name));
hgs
parents: 0
diff changeset
   566
                    }
hgs
parents: 0
diff changeset
   567
        if(iGASKeypadVolume!=settings.KeypadVolume())
hgs
parents: 0
diff changeset
   568
            {
hgs
parents: 0
diff changeset
   569
              
hgs
parents: 0
diff changeset
   570
              CMapGASKeypadVolume(settings.KeypadVolume());
hgs
parents: 0
diff changeset
   571
              User::LeaveIfError(iKeypadVolumeProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   572
                                                                                        KGASKeypadToneVolume,
hgs
parents: 0
diff changeset
   573
                                                                                        iGASKeypadVolume));
hgs
parents: 0
diff changeset
   574
              
hgs
parents: 0
diff changeset
   575
              
hgs
parents: 0
diff changeset
   576
            }
43
hgs
parents: 38
diff changeset
   577
        if(iSilenceMode != iProfileEngineExtended->SilenceModeL())
hgs
parents: 38
diff changeset
   578
            {
hgs
parents: 38
diff changeset
   579
             RDebug::Printf("silence mode changed");
hgs
parents: 38
diff changeset
   580
             iSilenceMode = iProfileEngineExtended->SilenceModeL();
hgs
parents: 38
diff changeset
   581
             User::LeaveIfError(iSilenceModeProperty.Set(
hgs
parents: 38
diff changeset
   582
                                                        KGASPSUidGlobalAudioSettings,
hgs
parents: 38
diff changeset
   583
                                                        KGASSilenceMode,
hgs
parents: 38
diff changeset
   584
                                                        iSilenceMode));
hgs
parents: 38
diff changeset
   585
            }
hgs
parents: 38
diff changeset
   586
        
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   587
        CleanupStack::PopAndDestroy(currentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   588
        }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   589
#ifdef _DEBUG
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   590
    else
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   591
        {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   592
        RDebug::Print(_L("CProfileSettingsMonitorServerImpl::HandleProfileActivatedL[%d]- \
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   593
            Activated is same as current profile"), aProfileId);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   594
        }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   595
#endif // _DEBUG    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   596
    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   597
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   598
void CProfileSettingsMonitorServerImpl::HandleProfileActivationNotificationError( TInt /*aError*/ )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   599
    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   600
    DEB_TRACE0(_L("CMyProfileNameArrayObserver::HandleProfileActivationNotificationError"));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   601
	}
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   602
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   603
void CProfileSettingsMonitorServerImpl::HandleActiveProfileModifiedL()
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   604
    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   605
    DEB_TRACE0(_L("CProfileSettingsMonitorServerImpl::HandleActiveProfileModifiedL"));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   606
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   607
    iActiveProfileId = iEngine->ActiveProfileId();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   608
    MProEngProfile* currentProfile = iEngine->ActiveProfileL();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   609
    CleanupReleasePushL(*currentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   610
    
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   611
    MProEngToneSettings& settings = currentProfile->ToneSettings();
38
hgs
parents: 0
diff changeset
   612
    MProEngTones& profileTones=currentProfile->ProfileTones();
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   613
    if(iWarningTones != settings.WarningAndGameTones())
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   614
        {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   615
        iWarningTones = settings.WarningAndGameTones();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   616
        User::LeaveIfError(iWarningTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   617
                                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   618
                                                    KGASWarningTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   619
                                                    iWarningTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   620
        }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   621
    if(iMessagingTones != (!( currentProfile->IsSilent() )))
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   622
        {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   623
        iMessagingTones = !( currentProfile->IsSilent() );
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   624
        User::LeaveIfError(iMessagingTonesProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   625
                                                    KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   626
                                                    KGASMessageTones,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   627
                                                    iMessagingTones));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   628
        }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   629
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   630
    if(iVibra != settings.VibratingAlert())
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   631
        {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   632
        iVibra = settings.VibratingAlert();
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   633
        User::LeaveIfError(iVibraProperty.Set(
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   634
                                            KGASPSUidGlobalAudioSettings,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   635
                                            KGASVibra,
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   636
                                            iVibra));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   637
        }
38
hgs
parents: 0
diff changeset
   638
    if(iGASRingingType != settings.RingingType())
hgs
parents: 0
diff changeset
   639
        {
hgs
parents: 0
diff changeset
   640
        
hgs
parents: 0
diff changeset
   641
         CMapGASRingingType(settings.RingingType());
hgs
parents: 0
diff changeset
   642
         
hgs
parents: 0
diff changeset
   643
         User::LeaveIfError(iRingingTypeProperty.Set(
hgs
parents: 0
diff changeset
   644
                                                     KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   645
                                                     KGASRingingType,
hgs
parents: 0
diff changeset
   646
                                                     iGASRingingType));
hgs
parents: 0
diff changeset
   647
        }
hgs
parents: 0
diff changeset
   648
    if(iMessageToneName->Compare(profileTones.MessageAlertTone())!= 0)
hgs
parents: 0
diff changeset
   649
        {
hgs
parents: 0
diff changeset
   650
          delete iMessageToneName;
hgs
parents: 0
diff changeset
   651
          iMessageToneName=NULL;
hgs
parents: 0
diff changeset
   652
          iMessageToneName=profileTones.MessageAlertTone().AllocL();
hgs
parents: 0
diff changeset
   653
          
hgs
parents: 0
diff changeset
   654
          User::LeaveIfError(iMessageToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   655
                                                          KGASMessageToneName,
hgs
parents: 0
diff changeset
   656
                                                          *iMessageToneName));
hgs
parents: 0
diff changeset
   657
        }
hgs
parents: 0
diff changeset
   658
    
hgs
parents: 0
diff changeset
   659
    if(iEmailToneName->Compare(profileTones.EmailAlertTone())!= 0)
hgs
parents: 0
diff changeset
   660
        {
hgs
parents: 0
diff changeset
   661
          delete iEmailToneName;
hgs
parents: 0
diff changeset
   662
          iEmailToneName=NULL;
hgs
parents: 0
diff changeset
   663
          iEmailToneName=profileTones.EmailAlertTone().AllocL();
hgs
parents: 0
diff changeset
   664
          User::LeaveIfError(iEmailToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   665
                                                                        KGASEmailToneName,
hgs
parents: 0
diff changeset
   666
                                                                        *iEmailToneName));
hgs
parents: 0
diff changeset
   667
        }
hgs
parents: 0
diff changeset
   668
    if(iVideoCallToneName->Compare(profileTones.VideoCallRingingTone())!=0)
hgs
parents: 0
diff changeset
   669
        {
hgs
parents: 0
diff changeset
   670
          delete iVideoCallToneName;
hgs
parents: 0
diff changeset
   671
          iVideoCallToneName=NULL;
hgs
parents: 0
diff changeset
   672
          iVideoCallToneName=profileTones.VideoCallRingingTone().AllocL();
hgs
parents: 0
diff changeset
   673
          User::LeaveIfError(iVideoCallToneNameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   674
                                                                                      KGASVideoCallToneName,
hgs
parents: 0
diff changeset
   675
                                                                                      *iVideoCallToneName));
hgs
parents: 0
diff changeset
   676
          
hgs
parents: 0
diff changeset
   677
        }
hgs
parents: 0
diff changeset
   678
    if(iRingingTone1Name->Compare(profileTones.RingingTone1())!=0)
hgs
parents: 0
diff changeset
   679
        {
hgs
parents: 0
diff changeset
   680
         delete iRingingTone1Name;
hgs
parents: 0
diff changeset
   681
         iRingingTone1Name=NULL;
hgs
parents: 0
diff changeset
   682
         iRingingTone1Name=profileTones.RingingTone1().AllocL();
hgs
parents: 0
diff changeset
   683
         User::LeaveIfError(iRingingTone1NameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   684
                                                                                  KGASRingingTone1Name,
hgs
parents: 0
diff changeset
   685
                                                                                  *iRingingTone1Name));
hgs
parents: 0
diff changeset
   686
         
hgs
parents: 0
diff changeset
   687
        }
hgs
parents: 0
diff changeset
   688
    if(iRingingTone2Name->Compare(profileTones.RingingTone2())!=0)
hgs
parents: 0
diff changeset
   689
        {
hgs
parents: 0
diff changeset
   690
          delete iRingingTone2Name;
hgs
parents: 0
diff changeset
   691
          iRingingTone2Name=NULL;
hgs
parents: 0
diff changeset
   692
          iRingingTone2Name=profileTones.RingingTone2().AllocL();
hgs
parents: 0
diff changeset
   693
          User::LeaveIfError(iRingingTone2NameProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   694
                                                                                      KGASRingingTone2Name,
hgs
parents: 0
diff changeset
   695
                                                                                      *iRingingTone2Name));
hgs
parents: 0
diff changeset
   696
         
hgs
parents: 0
diff changeset
   697
            }
hgs
parents: 0
diff changeset
   698
    if(iGASKeypadVolume!=settings.KeypadVolume())
hgs
parents: 0
diff changeset
   699
        {
hgs
parents: 0
diff changeset
   700
         
hgs
parents: 0
diff changeset
   701
          CMapGASKeypadVolume( settings.KeypadVolume());
hgs
parents: 0
diff changeset
   702
          User::LeaveIfError(iKeypadVolumeProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 0
diff changeset
   703
                                                                                                KGASKeypadToneVolume,
hgs
parents: 0
diff changeset
   704
                                                                                                iGASKeypadVolume));
hgs
parents: 0
diff changeset
   705
          
hgs
parents: 0
diff changeset
   706
          
hgs
parents: 0
diff changeset
   707
        }
43
hgs
parents: 38
diff changeset
   708
    if(iSilenceMode != iProfileEngineExtended ->SilenceModeL())
hgs
parents: 38
diff changeset
   709
        {
hgs
parents: 38
diff changeset
   710
    RDebug::Printf("silence mode changed");
hgs
parents: 38
diff changeset
   711
         iSilenceMode = iProfileEngineExtended ->SilenceModeL();
hgs
parents: 38
diff changeset
   712
         User::LeaveIfError(iSilenceModeProperty.Set(KGASPSUidGlobalAudioSettings,
hgs
parents: 38
diff changeset
   713
                                                                                KGASSilenceMode,
hgs
parents: 38
diff changeset
   714
                                                                                iSilenceMode));
hgs
parents: 38
diff changeset
   715
         }
hgs
parents: 38
diff changeset
   716
   
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   717
    CleanupStack::PopAndDestroy(currentProfile);
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   718
    }
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   719
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   720
void CProfileSettingsMonitorServerImpl::HandleActiveProfileNotificationError( TInt /*aError*/ )
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   721
    {
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   722
    DEB_TRACE0(_L("CMyProfileNameArrayObserver::HandleProfileActivationNotificationError"));
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   723
	}
38
hgs
parents: 0
diff changeset
   724
void CProfileSettingsMonitorServerImpl::CMapGASRingingType(TProfileRingingType aRingingType)
hgs
parents: 0
diff changeset
   725
    {
hgs
parents: 0
diff changeset
   726
    switch(aRingingType)
hgs
parents: 0
diff changeset
   727
            {
hgs
parents: 0
diff changeset
   728
            case EProfileRingingTypeRinging :   iGASRingingType=CGlobalAudioSettings::EGASRingingTypeRinging;
hgs
parents: 0
diff changeset
   729
                                                 break;
hgs
parents: 0
diff changeset
   730
               
hgs
parents: 0
diff changeset
   731
            case EProfileRingingTypeAscending:iGASRingingType=CGlobalAudioSettings::EGASRingingTypeAscending;
hgs
parents: 0
diff changeset
   732
                                               break;
hgs
parents: 0
diff changeset
   733
              
hgs
parents: 0
diff changeset
   734
            case EProfileRingingTypeRingingOnce :iGASRingingType=CGlobalAudioSettings::EGASRingingTypeRingingOnce;
hgs
parents: 0
diff changeset
   735
                                                  break;
hgs
parents: 0
diff changeset
   736
               
hgs
parents: 0
diff changeset
   737
            case EProfileRingingTypeBeepOnce :iGASRingingType=CGlobalAudioSettings::EGASRingingTypeBeepOnce;
hgs
parents: 0
diff changeset
   738
                                              break;
hgs
parents: 0
diff changeset
   739
               
hgs
parents: 0
diff changeset
   740
            case EProfileRingingTypeSilent:iGASRingingType=CGlobalAudioSettings::EGASRingingTypeSilent;
hgs
parents: 0
diff changeset
   741
                                           break;
hgs
parents: 0
diff changeset
   742
            }
hgs
parents: 0
diff changeset
   743
    }
hgs
parents: 0
diff changeset
   744
void CProfileSettingsMonitorServerImpl::CMapGASKeypadVolume(TProfileKeypadVolume aKeypadVolume)
hgs
parents: 0
diff changeset
   745
    {
hgs
parents: 0
diff changeset
   746
     switch(aKeypadVolume)
hgs
parents: 0
diff changeset
   747
         {
hgs
parents: 0
diff changeset
   748
         case  EProfileKeypadVolumeOff  : iGASKeypadVolume=CGlobalAudioSettings::EGASKeypadVolumeOff;
hgs
parents: 0
diff changeset
   749
                                          break;
hgs
parents: 0
diff changeset
   750
         case EProfileKeypadVolumeLevel1 :iGASKeypadVolume=CGlobalAudioSettings::EGASKeypadVolumeLevel1;
hgs
parents: 0
diff changeset
   751
                                          break;
hgs
parents: 0
diff changeset
   752
         case EProfileKeypadVolumeLevel2 :iGASKeypadVolume=CGlobalAudioSettings::EGASKeypadVolumeLevel2;
hgs
parents: 0
diff changeset
   753
                                          break;
hgs
parents: 0
diff changeset
   754
         case  EProfileKeypadVolumeLevel3 :iGASKeypadVolume=CGlobalAudioSettings::EGASKeypadVolumeLevel3;
hgs
parents: 0
diff changeset
   755
                                           break;
hgs
parents: 0
diff changeset
   756
         }
hgs
parents: 0
diff changeset
   757
    }
0
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   758
// End of file
71ca22bcf22a Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   759