Migrating from Feature Registry to Feature Manager

Provides detailed instructions for migrating Feature registry to Feature Manager runtime and buildtime.

Migrating to Feature Manager runtime APIs

FeatureRegistry queries the presence of a feature with the functions QuerySupport() and QuerySupportS() which are now deprecated. The publishPartner version of Feature Manager implements the corresponding functionality with a choice of function calls, either static or dynamic. The SDK version only provides the static function calls.

Old New

TInt RFeatureRegistry:: QuerySupport(TUid aFeatureUid)

TInt RFeatureControl:: FeatureSupported( TUid aFeature )

TInt RFeatureRegistry:: QuerySupport(TUid aFeatureUid, TUint32& aInfo);

TInt RFeatureControl::FeatureSupported( TFeatureEntry& aFeature )

TInt static RFeatureRegistry:: QuerySupportS(TUid aFeatureUid);

TBool static CFeatureDiscovery ::IsFeatureSupportedL( TUid aFeature )

TInt static RFeatureRegistry:: QuerySupportS(TUid aFeatureUid);

Dynamic calls to the Open(), FeatureSupported() and Close() functions of an RFeatureControl object.

TInt static RFeatureRegistry:: QuerySupportS(TUid aFeatureUid, TUint32& aInfo);

TBool static CFeatureDiscovery ::IsFeatureSupportedL( TUid aFeature )

TInt static RFeatureRegistry:: QuerySupportS(TUid aFeatureUid, TUint32& aInfo);

Dynamic calls to the Open(), FeatureSupported() and Close() functions of an RFeatureControl object.

Migrating to Feature Manager buildtime tooling

The transition from Feature Registry to Feature Manager also involves changes to the process of building ROM. Features can be included in ROM as a partial build with the purpose of upgrading features, or as the corresponding section of a full build: the changes to the procedure are the same either way.

Two tools are used to automate the process: a new version of the old tool buildrom and a new tool features.

The procedure for building ROM uses a feature database in the form of an an .xml file to specify the features to be included and an .iby file to specify those to be excluded. The structure of these files has been modified slightly.

The old feature database, called featureUIDs.xml is replaced by a new version called featuredatabase.xml with a new XML structure. The old XML tags correspond to the new ones like this.

Feature Registry Feature Manager

<featureuids>

<featuredatabase>

<features>

<featureset>

<features>:: uid

<feature>::uid

<features>::name

<feature>::name

None

<feature>:: statusflags

<default>

<defaultfeaturerange>

<default>:: min

<defaultfeaturerange>:: loweruid

<default>:: max

<defaultfeaturerange>:: higheruid

<default>:: support

<defaultfeaturerange>:: support

The values of the attributes are the same in both versions of the schema. The new attribute statusflags of <feature> takes the mandatory value of 0x00000001.

You can upgrade your XML feature database in three ways.

  • by upgrading the file manually in accordance with the equivalences given,

  • by calling the tool features to perform the conversion automatically, or

  • by leaving the file as it is and calling the tool buildrom with the flag -fm.

You call the tool features like this:

features -c <destination> featureUIDs.xml

where -c is a flag forcing the conversion. The output is a file featureUIDs_converted.xml in the folder specified at <destination>.

Whether or not you force the conversion, a call to features will generate the file feature.iby and the header file featureUIDs.h.

The .iby file, called feature.iby, has a new extended syntax. There are now two new flags which override the default values for the status flags and user-defined data:

  • SF followed by a value for the status flags of the feature, and

  • UD followed by a value for the user-defined data for the feature.

For example:

EXCLUDE_FEATURE Fax SF 0x00000008 
FEATURE Print UD 0x00000010 
        

The possible values and significance of the status flags are listed in the enumeration TFeatureFlags. The user-defined data consists of a 32 bit integer.

If you call the tool buildrom with the new flag -fm then it will convert featureUIDs.xml into featuredatabase.xml. This flag replaces the old -f and -fr.