Adding a Feature

How to add a feature using RFeatureControl.

To add a feature using RFeatureControl, take the following steps.


  1. Determine the Uid of the feature you want to add,

  2. create an instance of TFeatureEntry,

  3. set its Uid, feature flags and feature data to the correct values for the feature you want to add,

  4. create an instance of RFeatureControl,

  5. call its Open() function,

  6. call its AddFeature() function with a reference to the TFeatureEntry as argument, and

  7. call its Close() function.

The call to AddFeature() requires WriteDeviceData capability. It returns:

  • KErrNone if the feature was successfully added,

  • KPermissionDenied if a capability check fails,

  • KAlreadyExists if the feature already exists, and

  • otherwise returns an error code.