Resume函数:
@Override
public void onResume() {
super.onResume();
PreferenceGroup parentPreference = getPreferenceScreen();
mDevHitCountdown = getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE,
Context.MODE_PRIVATE).getBoolean(DevelopmentSettings.PREF_SHOW,
android.os.Build.TYPE.equals(“eng”)) ? -1 : TAPS_TO_BE_A_DEVELOPER;
mDevHitToast = null;
}
Setting的默认初始配置
frameworks/base/packages/SettingsProvider/res/values/default.xml
这里貌似可以修改很多东西,但要在
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
中初始化才会生效:
true
/mnt/sdcard
true
60000
false
cell,bluetooth,wifi,nfc,wimax
bluetooth,wifi,nfc
true
true
true
102
false
100%
100%
true
false
false
false
true
true
true
true
false
0
true
false
com.google.android.backup/.BackupTransportService
true
true
false
true
true
1
/system/media/audio/ui/LowBattery.ogg
0
/system/media/audio/ui/Dock.ogg
/system/media/audio/ui/Undock.ogg
/system/media/audio/ui/Dock.ogg
/system/media/audio/ui/Undock.ogg
1
/system/media/audio/ui/Lock.ogg
/system/media/audio/ui/Unlock.ogg
/system/media/audio/ui/WirelessChargingStarted.ogg
false
false
1
true
true
false
false
0x13=0x01000100;
0x14=0x01010100;
0x15=0x02000001;
0x16=0x02010001;
0x200000013=0x02000601;
0x200000014=0x02010601;
0x200000015=0x03020101;
0x200000016=0x03010201;
0x200000023=0x02000301;
0x200000024=0x02010301;
0x200000037=0x03070201;
0x200000038=0x03000701:0x03010701:0x03020701;
https://ssl.gstatic.com/accessibility/javascript/android/AndroidVox_v1.js
false
200%
false
true
0
-1
-1
500
0
true
false
false
9
false
0
当然还有mtk_default.xml
修改完成后,在
frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
中的 private void loadGlobalSettings(SQLiteDatabase db) { … … }函数中增加初始化数据库的值:
然后执行:
./mk -t mm frameworks/base/packages/SettingsProvider/
生成目录:
out/target/product/esky82_tb_cn_kk/system/priv-app/SettingsProvider.apk
删除设置中情景模式的震动选项(会议模式和户外模式)
packages/apps/Settings/res/xml/audioprofile_settings.xml
注释掉会议模式和户外模式
packages/apps/Settings/res/xml/edit_profile_prefs.xml
注释掉:
<PreferenceCategory
android:key=“general”
android:title="@string/sound_category_sound_title"/>
<com.mediatek.audioprofile.RingerVolumePreference
android:key=“ring_volume”
android:title="@string/all_volume_title"
android:dialogTitle="@string/all_volume_title"
android:persistent=“false”/>
packages/apps/Settings/src/com/medietek/audrioprofile/AduioProfileSettings.java
注释掉public void onCreate(Bundle icicle) {}中以下几行代码:
//pref = (AudioProfilePreference) findPreference(MEETING_PREF_KEY);
//pref.setOnSettingsClickListener(mProfileSettingListener);
//pref = (AudioProfilePreference) findPreference(OUTDOOR_PREF_KEY);
//pref.setOnSettingsClickListener(mProfileSettingListener);
或者改成以下:
这个方案得:import android.os.SystemProperties;
if (!SystemProperties.get(“ro.project.target”).equals(“es706”)) {
// Do nothing
} else {
pref = (AudioProfilePreference) findPreference(MEETING_PREF_KEY);
pref.setOnSettingsClickListener(mProfileSettingListener);
pref = (AudioProfilePreference) findPreference(OUTDOOR_PREF_KEY);
pref.setOnSettingsClickListen