Namespaces
Variants
Actions

Removing send via Bluetooth from send menu

Jump to: navigation, search
Article Metadata

Code Example
Article
Created: mahbub_s60 (03 Jun 2010)
Last edited: hamishwillee (26 Jul 2012)


Contents

Description

When user selects send menu then a sub menu is displayed like send via Bluetooth. During runtime if device management software want to prevent for example sending via Bluetooth, then this solution can be used.

Solution

When the device management software want to remove the option then it can call DeInstallMtmGroup with the Mtm resource file. Once the Mtm is uninstalled then send ui will not find the Mtm and as result the menu item will not be shown. When we want to restore the option then we call InstallMtmGroup again.

Code for removing send via Bluetooth menu item.

            // English language, check for other language
_LIT(KMTMDataLocation,"z:\\resource\\messaging\\mtm\\btmtm.r01");
 
CMsvSession* session = CMsvSession::OpenSyncL(*this);
CleanupStack::PushL(session);
TInt err=session->DeInstallMtmGroup(KMTMDataLocation);
 
if (err!=KErrNone && err!=KErrNotFound)
{
User::Leave(err);
}
CleanupStack::PopAndDestroy(session); // session


Code for re storing send via Bluetooth menu item.

            // English language, check for other language
_LIT(KMTMDataLocation,"z:\\resource\\messaging\\mtm\\btmtm.r01");
CMsvSession* session = CMsvSession::OpenSyncL(*this);
CleanupStack::PushL(session);
TInt err=session->InstallMtmGroup(KMTMDataLocation);
 
if (err!=KErrNone && err!=KErrNotFound)
{
User::Leave(err);
}
CleanupStack::PopAndDestroy(session); // session

Some related articles

How to block IP packet with IPhook module based on IP address
How to prevent data sending over Infrared programatically
Removing send via Bluetooth from send menu
How to prevent web browsing with WLAN programatically

Required Capability and Example

WriteDeviceData is necessary to execute DeInstallMtmGroup() method. File:BTSendMenuOnOff.zip

This page was last modified on 26 July 2012, at 08:24.
77 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved