首页 新闻 会员 周边 捐助

android的property_set失败

0
[待解决问题]

想问下 为什么我在typeface.cpp里 用property_set然后再property_get获取 不成功呢? 代码如下

property_set("runtime.default.font","fat2");
property_set("runtime.default.xmlpath","/data/vendor_fonts.xml");

gFontStyle = (char*)malloc(30*sizeof(char));
xmlPath2 = (char*)malloc(30*sizeof(char));

property_get("runtime.default.font",gFontStyle,"");
property_get("runtime.default.xmlpath",xmlPath2,"");

AndyLau2的主页 AndyLau2 | 菜鸟二级 | 园豆:202
提问于:2013-02-21 10:34
< >
分享
所有回答(1)
0

property的设置是需要权限的,你在哪个进程里面做的?

runtime开头的prop需要system权限,下面是部分权限的要求。

/* White list of permissions for setting property services. */
struct {
    const char *prefix;
    unsigned int uid;
    unsigned int gid;
} property_perms[] = {
    { "net.rmnet0.",      AID_RADIO,    0 },
    { "net.gprs.",        AID_RADIO,    0 },
    { "net.ppp",          AID_RADIO,    0 },
    { "net.qmi",          AID_RADIO,    0 },
    { "net.lte",          AID_RADIO,    0 },
    { "net.cdma",         AID_RADIO,    0 },
    { "ril.",             AID_RADIO,    0 },
    { "gsm.",             AID_RADIO,    0 },
    { "persist.radio",    AID_RADIO,    0 },
    { "net.dns",          AID_RADIO,    0 },
    { "sys.usb.config",   AID_RADIO,    0 },
    { "net.",             AID_SYSTEM,   0 },
    { "dev.",             AID_SYSTEM,   0 },
    { "runtime.",         AID_SYSTEM,   0 },
    { "hw.",              AID_SYSTEM,   0 },

...

yards | 园豆:227 (菜鸟二级) | 2014-07-31 16:22
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册