Removing send via Bluetooth from send menu
Article Metadata
Code Example
Article
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
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


(no comments yet)