×
Namespaces

Variants
Actions
Revision as of 09:03, 28 October 2011 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

, 获取情景模式与铃音文件

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
qxiaoyuan 在 23 May 2009 创建
最后由 hamishwillee 在 28 Oct 2011 编辑

一直以来为了读取/设置到用户的情景模式, 短信提示音, 都是很郁闷的使用nokia提供的mr的plugin api和fp1自己的api, 因为不同库, 所以必须发布2个版本, 提交express时浪费了无数的money和精力(维护, 验证, 测试).

后来, 读到子腾大侠的无敌吸星大法, 才知道还有种方法敲开symbian的重重内幕, 今天终于下定决心, 参考子腾大侠的


http://www.developer.nokia.com/Community/Discussion/showthread.php?165178

无敌吸星大法, 解决了这个问题, 比较发现 0x101F8798是CRepository的key, 而0x7e000001是情景模式的index, 短信提示音是mode的一个位移算法, 类似的手机铃音只是下一个值而已, 贴出我的测试代码的核心, 大家一看即知

const char* profile[] = { "biaozhun", "wusheng", "huiyi", "huwai", "xunhuji", "lixian", };
CRepository* cenrep = CRepository::NewLC(TUid::Uid(0x101F8798));
 
TInt mode = -1;
User::LeaveIfError(cenrep->Get(0x7e000001, mode));
 
TInt k = mode << 24 | 0x04;
TFileName toneFile;
User::LeaveIfError(cenrep->Get(k, toneFile));
 
CleanupStack::PopAndDestroy(cenrep);
 
TBuf8<100> pm( (const TUint8*)profile[mode] );
TBuf<512> buf;
buf.Copy(pm);
buf.Append(_L("\r\n"));
buf.Append(toneFile);
 
CAknInformationNote* informationNote = new ( ELeave ) CAknInformationNote;
informationNote->ExecuteLD( buf );
This page was last modified on 28 October 2011, at 09:03.
146 page views in the last 30 days.