Profile data on 3rd edition

On 1st edition and early 2nd edition FPs, there was no officially sanctioned way to get profile data, although CProfileAPI was easy enough to generate from the LIB files. Later we got CSettingInfo. In 3rd edition profile data is kept in the central repository, and you can access some of it with the keys in profileenginesdkcrkeys.h.

But the documented keys only provide access to a subset of the profile data, for example not to vibrating alert status or the ringing tone. And it’s read-only.

Luckily, CRepository allows you to enumerate keys. You just open the repository with the CRepository::NewL(KCRUidProfileEngine), and enumerate them with:

CRepository* iRep;
iRep=CRepository::NewL(KCRUidProfileEngine);
RArray<TUint32> found;
iRep->FindL(0, 0, found);
for (int i=0; i<found.Count(); i++) {
    key=found[i];
    /* do something with the key*/
}

Dumping the keys from the profile repository gives something like:

UID 101f8798
Key 0 0000b7ff
Key 1 0000b7ff
Key 2
Key 3
Key 4 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 5 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 6 Z:\Data\Sounds\Digital\Message.mid
Key 7 value 0
Key 8 value 2
Key 9 value 7
Key a value 1
Key b value 1
Key c Z:\Data\Sounds\Digital\Chat alert.mid
Key d Z:\Data\Sounds\Digital\Message.mid
Key e Z:\Data\Sounds\Digital\Nokia Tune.mid
Key f
Key 10 value 2
Key 11 value 7
Key 12 value 0
Key 13 value 1
Key 14
Key 15 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 16 value 1
Key 1000000 0000bfff
Key 1000001 0000bfff
Key 1000002
Key 1000003 0000
Key 1000004 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 1000005 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 1000006 Z:\resource\No_Sound.wav
Key 1000007 value 4
Key 1000008 value 0
Key 1000009 value 1
Key 100000a value 0
Key 100000b value 0
Key 100000c Z:\resource\No_Sound.wav
Key 100000d Z:\resource\No_Sound.wav
Key 100000e Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 100000f
Key 1000010 value 1
Key 1000011 value 1
Key 1000012 value 0
Key 1000013 value 1
Key 1000014
Key 1000015 Z:\Data\Sounds\Digital\Nokia Tune.mid
Key 1000016 value 1

Figuring out what values are what can be done easily enough by changing the fields in Profiles and re-dumping the data. It works in the emulator. Some of the keys are (given the current profile number in id):

  • id << 24 | 0xa : Vibra
  • id << 24 | 0x2 : Custom name

Names of built-in profiles are not in cenrep (hello, Nokia! how about giving an abstraction layer that works for once). You have to hardcode them, or read the raw bytes from the relevant resource file.

I would assume you can change any of this values through cenrep if you have WriteUserData as well. Haven’t tested it yet.

This entry was posted in Symbian. Bookmark the permalink.

13 Responses to Profile data on 3rd edition

  1. Paul Todd says:

    What is a lot more irritating is that in FP1 there is now a profile api but it has been engineered to be totally incompatible with the existing unpublished API.

    I fail to believe how it can be justified that someone went and engineered a whole new API just to prevent the existing one being used.

    I am still working on the central rep keys – it seems that there are multiple keys in different repositories that change when a profile is changed

    By the way if you are in Helsinki and want to meet for a beer Friday (1st) or (2nd) Sat drop me an email.

  2. Riho says:

    I can’t understand why is Nokia so scared that someone may read and change settings. In pre 9 versions there was this undocumented SettingInfo to handle INI files. It worked very well and we used it to store and exchange our programs settings. Now it is dropped and nothing useful is given in exchange, only different kind of crap.

  3. cyke64 says:

    hello Mika ,

    Could you say to me what is the type of ‘key’ ? I’m beginner in C++ :(

  4. Luca says:

    Hi Mika,

    I should changing ringing volume and profile on S60 v.3rd.
    For example, using iRepository->Set(KProEngActiveProfile, 3); I can change active profile but only on the emulator, but on Nokia 3250 no change also using WriteUserData capability.

    Could you please suggest to me a clue about this? Is it possible?

    Thanks a lot, Luca

  5. Mika says:

    You can’t change the profile via CenRep. The profile engine just propagates changes in it to CenRep. That the key can be written to by you is just unfortunate.

    For changing the profile, use the Profiles Engine from the 3rd edition SDK Plug-in pack v3. See http://newlc.com/40-New-APIs-for-S60-3rd-Edition-MR.html

  6. Luca says:

    I tried to use the API but I have this message: “unable to execute file for security reasons” on this line:

    MProfileEngine* profileEngine = CreateProfileEngineL();

    What could be the problem in your opinion? Could the issue be any capability lack?

    Anyway API’s documentation doesn’t quote any capability

    Thank you for your availability,
    Luca

  7. Mika says:

    What capabilities do you have? I would assume it to need at least Read/WriteUserData and quite possibly Read/WriteDeviceData.

    I haven’t tested what the minimal caps are. We run with

    CAPABILITY ReadDeviceData ReadUserData WriteUserData LocalServices Location NetworkServices UserEnvironment WriteDeviceData SwEvent.

  8. Mika says:

    And not having accurate capability info is le thing at Nokia. No point in getting uptight about it.

  9. Luca says:

    Thank you, now it’s ok. I was only using WriteUserData

    Bye, Luca

  10. Snop says:

    Moro, sellaista kyselisin että minkälaisella koodilla/koodinlisäyksellä saisi kerättyä tiedot puhelimen järjestelmästä(system properties),kielenä Symbian tai Java??vinkkejä?

  11. ygw says:

    thank you very much , i have get my wanted object,the key is a handiness methods
    i had change the ringtone on symbian os 3rd

  12. Tili says:

    I tried reading whole API but I can’t find a way to change sms alert tone for currently selected profile.
    How can one do that?