Android修改分析:默认属性修改

默认亮度

vendor/mediatek/proprietary/packages/apps/SettingsProvider/res/values/defaults.xml

<integer name="def_screen_brightness">94</integer>

默认音量

device/mediatek/system/common/system.prop

   ro.config.vc_call_vol_steps=7
   ro.config.vc_call_vol_default=6
   ro.config.media_vol_steps=15
   ro.config.media_vol_default=15
   ro.config.system_vol_steps=15
   ro.config.system_vol_default=15

frameworks/base/services/core/java/com/android/server/audio/AudioService.java

        int defaultAlarmVolume = SystemProperties.getInt("ro.config.alarm_vol_default", -1);
        if (defaultAlarmVolume != -1 && defaultAlarmVolume <= MAX_STREAM_VOLUME[AudioSystem.STREAM_ALARM]) {
            AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_ALARM] = defaultAlarmVolume;
        }

       int defaultRingVolume = SystemProperties.getInt("ro.config.ring_vol_default", -1);
        if (defaultRingVolume != -1 && defaultRingVolume <= MAX_STREAM_VOLUME[AudioSystem.STREAM_RING]) {
            AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_RING] = defaultRingVolume;
        }

build/make/target/product/core_base.mk

 PRODUCT_PROPERTY_OVERRIDES +=      ro.config.voice_call_vol_def=7     ro.config.system_vol_def=15     ro.config.media_vol_default=12     ro.config.alarm_vol_default=12     ro.config.ring_vol_default=12

字体默认

将数据库中的设置默认值修改

vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

            if ("1".equals(android.os.SystemProperties.get("ro.def_small_font", "0"))) {
               loadSetting(stmt, Settings.System.FONT_SCALE, 0.85f);
            }

更新UI图标显示

vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java

                if ("1".equals(android.os.SystemProperties.get("ro.def_small_font", "0"))) {
                    return Settings.System.getFloat(mContext.getContentResolver(), name, 0.85f) != 0.85f;
                }

Android修改分析:默认属性修改

上一篇:javaweb中mapping的优先级问题


下一篇:Android按钮_单选框_多选框_文字框