# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270060285 -10800 # Node ID bc161388e3ceceed4d1f2f15b8cdd0af796d95d9 # Parent b79ee333c41d69c51e0928551bd1841b0f07b0b4 Revision: 201011 Kit: 201013 diff -r b79ee333c41d -r bc161388e3ce package_definition.xml --- a/package_definition.xml Mon Mar 15 12:40:33 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.cpp --- a/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.cpp Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileFileListSettingItem.cpp Wed Mar 31 21:31:25 2010 +0300 @@ -30,6 +30,7 @@ #include #include #include // For TCLFMediaType::ECLFMediaTypeVideo +#include // CFeatureDiscovery // for mediafilelist #include @@ -193,9 +194,13 @@ } // Size limit for voice call tone files + // Messaging tone size is also limited if the + // "FF_LIMITED_MESSAGE_AND_ALARM_TONE_SIZE" feature flag is enabled if ( id == EProfileSettingRingingToneId || id == EProfileSettingRingingToneLine1Id || - id == EProfileSettingRingingToneLine2Id ) + id == EProfileSettingRingingToneLine2Id || + ( id == EProfileSettingMessageAlertToneId && + CFeatureDiscovery::IsFeatureSupportedL( KFeatureIdFfLimitedMessageAndAlarmToneSize ) ) ) { TInt sizeLimitKB = 0; CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine ); @@ -204,7 +209,6 @@ CleanupStack::PopAndDestroy(); // cenrep list->SetAttrL( CMediaFileList::EAttrFileSize, sizeLimitKB ); - } diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileSettingsContainer.cpp --- a/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileSettingsContainer.cpp Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileSettingsContainer.cpp Wed Mar 31 21:31:25 2010 +0300 @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -76,6 +77,7 @@ #include #include #include +#include namespace { @@ -536,7 +538,9 @@ CAknSettingItemArray* array = SettingItemArray(); TUint32 flags( iProfile->VisibleFlags() ); TInt profileId( 0 ); - + const MProfileTones& tones = iProfile->ProfileTones(); + const TProfileToneSettings& toneSettings = tones.ToneSettings(); + TBool hide3DEcho = EFalse; TInt effect = iProfile->ProfileExtraSettings().Profile3DToneSettings().Effect(); if ( effect == EProfile3DEffectOff || effect == EProfile3DEffectStereoWidening ) @@ -614,10 +618,17 @@ SetItemHidden( EProfileSettingVibratingAlertId, array, ~flags & EProfileFlagVibratingAlert ); - - SetItemHidden( EProfileSettingEmailVibratingAlertId, array, - ~flags & EProfileFlagVibratingAlert ); - SetItemHidden( EProfileSettingKeypadVolumeId, array, + + if(!iCopyProfile->iVibratingAlert) + { + SetItemHidden( EProfileSettingEmailVibratingAlertId, array,ETrue ); + } + else + { + SetItemHidden( EProfileSettingEmailVibratingAlertId, array,EFalse ); + } + + SetItemHidden( EProfileSettingKeypadVolumeId, array, ~flags & EProfileFlagKeypadVolume ); SetItemHidden( EProfileSettingWarningAndGameTonesId, array, @@ -788,7 +799,13 @@ { iIndexHandler->StoreIndices(); } - + + TInt vibratingAlert = iCopyProfile->iVibratingAlert; + if( identifier == EProfileSettingVibratingAlertId && iIndexHandler ) + { + iIndexHandler->StoreIndices(); + } + // Set boolean value to ETrue that we know that the settings container // is in editing mode. iItemEdited = ETrue; @@ -834,6 +851,11 @@ { UpdateSettingsL( EFalse ); // hide 3DEcho if 3DEffect is off } + + if ( vibratingAlert != iCopyProfile->iVibratingAlert ) + { + UpdateSettingsL( EFalse ); //hide emailVibrating alert if vibrating alert is off + } } // If the setting is an external (= only in Tones View): iExternalSettingsHandler.StoreIfChangedL( identifier ); diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandler.cpp --- a/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandler.cpp Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/CProfileToneHandler.cpp Wed Mar 31 21:31:25 2010 +0300 @@ -463,15 +463,15 @@ } // Check whether file is supported by MMF - TBuf8 tempDataType; - tempDataType.Copy( dataType ); - - if( !ProfileMmfInfoUtility::IsMimeTypeSupportedL( tempDataType ) ) - { - // File is not supported by MMF - return KErrNotSupported; - } - + TBuf8 tempDataType; + tempDataType.Copy( dataType ); + if (!ProfileMmfInfoUtility::IsMimeTypeSupportedL(tempDataType) + && !ProfileMmfInfoUtility::IsHeaderDataSupportedL(aFileName)) + { + // File is not supported by MMF + return KErrNotSupported; + } + // Operator requirement. Check if the tones of this data type are blocked: if( iProfilesFeatures->IsBlockedType( dataType ) || iProfilesFeatures->IsExcludedType( dataType ) ) diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.cpp --- a/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.cpp Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.cpp Wed Mar 31 21:31:25 2010 +0300 @@ -27,7 +27,7 @@ #include #include #include - +#include namespace { // CONSTANTS @@ -88,5 +88,72 @@ return result; } +// ----------------------------------------------------------------------------- +// CProfileMmfInfoUtility::IsHeaderDataSupportedL +// ----------------------------------------------------------------------------- +// +TBool ProfileMmfInfoUtility::IsHeaderDataSupportedL( const TDesC& aFileName ) + { + TBool result( EFalse ); + //the max header length is 256 bytes + const TInt KMaxHeaderLength( 256 ); + HBufC8* header = HBufC8::NewLC( KMaxHeaderLength ); + TPtr8 headerPtr = header->Des(); + GetFileHeaderDataL( aFileName, headerPtr, KMaxHeaderLength ); + CMMFFormatSelectionParameters* formatPrms = + CMMFFormatSelectionParameters::NewLC(); + CMMFControllerPluginSelectionParameters* controllerPrms = + CMMFControllerPluginSelectionParameters::NewLC(); + + // Empty format parameters means: "get all the supported formats" + controllerPrms->SetRequiredPlayFormatSupportL( *formatPrms ); + RMMFControllerImplInfoArray cntrlArray; + controllerPrms->ListImplementationsL( cntrlArray ); + + for ( TInt i( cntrlArray.Count() - 1 ); i >= 0 && !result; --i ) + { + const RMMFFormatImplInfoArray& infoArray( cntrlArray[i]->PlayFormats() ); + + for ( TInt j(infoArray.Count() - 1); j >= 0; --j ) + { + if ( infoArray[j]->SupportsHeaderDataL( *header ) ) + { + result = ETrue; + break; + } + } + } + + cntrlArray.ResetAndDestroy(); + cntrlArray.Close(); + CleanupStack::PopAndDestroy( 3, header );//controllerPrms, formatPrms and header + + return result; + } + +// ----------------------------------------------------------------------------- +// CProfileMmfInfoUtility::GetFileHeaderDataL +// ----------------------------------------------------------------------------- +// +void ProfileMmfInfoUtility::GetFileHeaderDataL( const TDesC& aFileName, + TDes8& aHeaderData, TInt aMaxHeaderLength ) + { + TInt error = KErrNone; + using namespace ContentAccess; + TVirtualPathPtr path( aFileName, ContentAccess::KDefaultContentObject ); + CData* data = CData::NewLC( path, EContentShareReadWrite ); + TInt size = 0; + data->DataSizeL( size ); + if ( size > 0 ) + { + if ( size > aMaxHeaderLength ) + size = aMaxHeaderLength; + TInt pos = 0; + error = data->Seek( ESeekStart, pos ); + error = data->Read( aHeaderData, size ); + } + CleanupStack::PopAndDestroy(); // data + } + // End of File diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.h --- a/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.h Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/SettingsViewSrc/ProfileMmfInfoUtility.h Wed Mar 31 21:31:25 2010 +0300 @@ -45,6 +45,15 @@ * EFalse otherwise. */ static TBool IsMimeTypeSupportedL( const TDesC8& aMimeType ); + + /** + * Checks if the given file's header data is supported + * by MMF, especially for m4a drm files. + * @param aFileName the name of the file to be judged. + * @return ETrue if the given file is supported by MMF, + * EFalse otherwise. + */ + static TBool IsHeaderDataSupportedL( const TDesC& aFileName ); private: // Constructor and destructor @@ -56,6 +65,15 @@ // Destructor. ~ProfileMmfInfoUtility() {}; + + //internal use + /** + * Get the header data of the file + * @param aFileName specifies the name of the file. + * @param aHeaderData contains the header data of the file. + * @param aMaxLength the length of header data. + */ + static void GetFileHeaderDataL(const TDesC& aFileName, TDes8& aHeaderData, TInt aMaxLength); }; #endif // PROFILEMMFINFOUTILITY_H diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/group/ProfileSettingsView.mmp --- a/profilesapplication/Profiles/ProfileApp/group/ProfileSettingsView.mmp Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/group/ProfileSettingsView.mmp Wed Mar 31 21:31:25 2010 +0300 @@ -73,6 +73,7 @@ LIBRARY cntmodel.lib // Contact database LIBRARY pbkeng.lib // Phone Book contact engine LIBRARY commonengine.lib // Shared data +LIBRARY featdiscovery.lib // CFeatureDiscovery LIBRARY featmgr.lib // Feature Manager LIBRARY sssettings.lib // Phone settings (Alternate Line Service) LIBRARY mediaclientaudio.lib // MultiMedia Framework, audio client diff -r b79ee333c41d -r bc161388e3ce profilesapplication/Profiles/ProfileApp/loc/ProfileApp.loc --- a/profilesapplication/Profiles/ProfileApp/loc/ProfileApp.loc Mon Mar 15 12:40:33 2010 +0200 +++ b/profilesapplication/Profiles/ProfileApp/loc/ProfileApp.loc Wed Mar 31 21:31:25 2010 +0300 @@ -48,11 +48,11 @@ //l: list_setting_pane_t1 #define qtn_mode_vt_tone "Video Call tone" -// d:Error note shown when ringing tone can't be set +// d:Error note shown when a tone can't be set // d:because tone maximum file size is exceeded. // l:popup_note_window // r:3.1 -#define qtn_profiles_tone_maxsize_error "Files larger than %N KB cannot be set as ringing tone" +#define qtn_profiles_tone_maxsize_error "Unable to use tone. File size exceeds %N kB." //d: Profile settings list item for ringing type //l: list_setting_pane_t1