diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-96D9B512-5F6C-51D8-9780-BB38643CD967.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-96D9B512-5F6C-51D8-9780-BB38643CD967.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,43 @@ + + + + + +Enabling and Disabling a FeatureHow to enable and disable a feature using RFeatureControl.

A feature is any item of functionality which can be included in a phone build or excluded from it. To enable and disable a feature using RFeatureControl, take the following steps.

Create an instance of RFeatureControl, +// replace <featureUID> with a real Uid ) +#include <featurecontrol.h> +#include <featureinfo.h> // for feature definitions +CMyClass::MyMethodL() + { + // Replace KFeatureUidx with real feature Uid. + // Open() must be called before calling any other methods. + // Disconnect is done by calling the Close() method. + RFeatureControl featureControl; + call its Open() function, + TInt err = featureControl.Open(); + determine the Uid of the feature you wish to enable or disable, call the EnableFeature() or DisableFeature() function of the RFeatureControl object with the Uid of the feature as argument, and + if ( err == KErrNone ) + { + // Enable some feature. + + // EnableFeature() and DisableFeature() methods return + // KErrNone if the feature was succesfully enabled or disabled, + // KErrAccessDenied if the feature is not modifiable. + // KErrPermissionDenied a capability check fails, + // KErrNotFound if the feature does not exist and + // otherwise one of the Symbian error codes. + err = featureControl.EnableFeature( <featureUID> ); + call the Close() function of the RFeatureControl object. + // Remember to call CloseL after using RFeatureControl. + // It disconnects the Feature Manager server. + featureControl.Close(); + } + } +

The calls to EnableFeature() or DisableFeature() require WriteDeviceData capability. They both return:

  • KErrNone on success,

  • KErrAccessDenied if the feature is not modifiable,

  • KErrPermissionDenied if a capability check fails,

  • KErrNotFound if the feature does not exist, and

  • otherwise return an error code.

Setting and updating a + feature Adding a feature Feature Manager Collection Overview Feature Manager Modification Tutorials
\ No newline at end of file