Android Settings和SettingsProvider源码分析与修改

习惯了,看源码从AndroidManifest文件看起,先对工程有个大致的认识。

Settings也是经常需要改动的部分之一,包名:com.android.settings,工程名:Settings,代码量也不小,慢慢啃。

4.4 SDK的Settings的AndroidManifest文件有2100+行,用ADT格式化后变成2600+行,好吧。

首先是权限,直接把注释写在里面了:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /><!--读取外部存储 -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /><!--写外部存储 -->
    <uses-permission android:name="android.permission.WRITE_SETTINGS" /><!--写设置信息 -->
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" /><!-- 写安全级别设置信息-->
    <uses-permission android:name="android.permission.DEVICE_POWER" /><!--电源键 -->
    <uses-permission android:name="android.permission.CHANGE_CONFIGURATION" /><!-- 改变配置-->
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /><!--挂载和卸载文件系统 -->
    <uses-permission android:name="android.permission.VIBRATE" /><!--震动 -->
    <uses-permission android:name="android.permission.BLUETOOTH" /><!--蓝牙基础服务,连接已配对的设备 -->
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /><!-- 蓝牙管理,附加蓝牙功能,比如搜索并配对设备-->
    <uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" /><!--蓝牙高级 -->
    <uses-permission android:name="android.permission.NFC" /><!--NFC近场通讯 -->
    <uses-permission android:name="android.permission.HARDWARE_TEST" /><!--硬件检测 -->
    <uses-permission android:name="android.permission.CALL_PHONE" /><!--拨打电话 -->
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /><!--修改音频设置 -->
    <uses-permission android:name="android.permission.MASTER_CLEAR" /><!--恢复出厂设置 -->
    <uses-permission android:name="android.permission.USE_CREDENTIALS" /><!-- 读取用户授权码-->
    <uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" /><!-- 谷歌应用授权-->
    <uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER" /><!--管理下载管理 -->
    <uses-permission android:name="android.permission.READ_CONTACTS" /><!--读取联系人 -->
    <uses-permission android:name="android.permission.WRITE_CONTACTS" /><!--写入联系人信息 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><!--访问网络状态 -->
    <uses-permission android:name="android.permission.ACCESS_WIMAX_STATE" /><!--读取wimax无线局域网状态 -->
    <uses-permission android:name="android.permission.CHANGE_WIMAX_STATE" /><!--修改wimax无线局域网状态 -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /><!--读取wifi状态 -->
    <uses-permission android:name="com.android.certinstaller.INSTALL_AS_USER" /><!--以User状态安装 -->
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /><!--修改WiFi状态 -->
    <uses-permission android:name="android.permission.INTERNET" /><!--互联网 -->
    <uses-permission android:name="android.permission.CLEAR_APP_USER_DATA" /><!--清除用户的应用信息 -->
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /><!--获取手机状态 -->
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" /><!--修改手机状态 -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/><!--获取大致位置 -->
    <uses-permission android:name="android.permission.WRITE_APN_SETTINGS"/><!--写入APN信息 -->
    <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES"/><!--GoogleMap的一个功能,自动记录到过的地方 -->
    <uses-permission android:name="android.permission.READ_USER_DICTIONARY"/><!--读取用户目录 -->
    <uses-permission android:name="android.permission.WRITE_USER_DICTIONARY"/><!-- 写入用户目录-->
    <uses-permission android:name="android.permission.FORCE_STOP_PACKAGES"/><!--强制停止应用 -->
    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/><!--打包用户状态 -->
    <uses-permission android:name="android.permission.BATTERY_STATS"/><!--读取电池状态 -->
    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" /><!--读取设置信息 -->
    <uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" /><!--写入设置信息 -->
    <uses-permission android:name="android.permission.MOVE_PACKAGE" /><!--移动应用 -->
    <uses-permission android:name="android.permission.USE_CREDENTIALS" /><!--获取用户授权码 -->
    <uses-permission android:name="android.permission.BACKUP" /><!--备份 -->
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /><!--读取同步设置 -->
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /><!--写入同步设置 -->
    <uses-permission android:name="android.permission.READ_SYNC_STATS" /><!--读取同步状态 -->
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" /><!--读取同步设置 -->
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" /><!-- 写入同步设置-->
    <uses-permission android:name="android.permission.STATUS_BAR" /><!-- 状态栏-->
    <uses-permission android:name="android.permission.MANAGE_USB" /><!--管理USB -->
    <uses-permission android:name="android.permission.SET_POINTER_SPEED" /><!--设置指针速度 -->
    <uses-permission android:name="android.permission.SET_KEYBOARD_LAYOUT" /><!--设置键盘布局 -->
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" /><!--允许不同用户间的应用可以交互 -->
    <uses-permission android:name="android.permission.COPY_PROTECTED_DATA" /><!--复制保护资料 -->
    <uses-permission android:name="android.permission.MANAGE_USERS" /><!--管理用户 -->
    <uses-permission android:name="android.permission.READ_PROFILE" /><!--读取用户资料 -->
    <uses-permission android:name="android.permission.CONFIGURE_WIFI_DISPLAY" /><!--配置WiFi显示设备 -->
    <uses-permission android:name="android.permission.SET_TIME" /><!--设置时间 -->
    <uses-permission android:name="android.permission.ACCESS_NOTIFICATIONS" /><!--获取通知 -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /><!--接收启动完成广播 -->
    <uses-permission android:name="android.permission.WAKE_LOCK"/><!-- 唤醒-->
    <uses-permission android:name="android.permission.REBOOT" /><!--重启 -->
    <uses-permission android:name="android.permission.MANAGE_DEVICE_ADMINS" />
    <uses-permission android:name="android.permission.HOTKNOT" /><!-- MTK的一个类似于NFC的技术,可参照TCL的么么哒-->


Setting显示开发者选项的逻辑

默认User版本没有“开发者选项”,我们可以通过点击版本号7次来显示开发者模式,今天来看下代码中是如何处理的:

首先是packages/apps/Settings/src/com/android/settings/Settings.java的初始化处理:

布尔值showDev是否默认显示“开发者选项”:

 final boolean showDev = mDevelopmentPreferences.getBoolean(
                DevelopmentSettings.PREF_SHOW,
                android.os.Build.TYPE.equals("eng"));

如果想让开发者选项默认显示,不需要点击7次版本号,可直接将showDev置为true即可:

final boolean showDev = true; 

如果showDev为false,则在如下代码中隐藏“开发者选项”:

if (id == R.id.development_settings) {
                if (!showDev) {
                    target.remove(i);
                }
            } 


下面看一下点击版本号显示开发者选项的部分:

代码路径:packages/apps/Settings/src/com/android/settings/DeviceInfoSettings.java

首先是定义点击次数:

static final int TAPS_TO_BE_A_DEVELOPER = 7;


点击版本号的处理逻辑,若mDevHitCountdown小于0,则表示”开发者选项“已经显示,参考Resume函数的处理:

if (preference.getKey().equals(KEY_BUILD_NUMBER)) {
            // Don't enable developer options for secondary users.
            if (UserHandle.myUserId() != UserHandle.USER_OWNER) return true;

            if (mDevHitCountdown > 0) {
                if (mDevHitCountdown == 1) {
                    if (super.ensurePinRestrictedPreference(preference)) {
                        return true;
                    }
                }
                mDevHitCountdown--;
                if (mDevHitCountdown == 0) {
                    getActivity().getSharedPreferences(DevelopmentSettings.PREF_FILE,
                            Context.MODE_PRIVATE).edit().putBoolean(
                                    DevelopmentSettings.PREF_SHOW, true).apply();
                    if (mDevHitToast != null) {
                        mDevHitToast.cancel();
                    }
                    mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_on,
                            Toast.LENGTH_LONG);
                    mDevHitToast.show();
                } else if (mDevHitCountdown > 0
                        && mDevHitCountdown < (TAPS_TO_BE_A_DEVELOPER-2)) {
                    if (mDevHitToast != null) {
                        mDevHitToast.cancel();
                    }
                    mDevHitToast = Toast.makeText(getActivity(), getResources().getQuantityString(
                            R.plurals.show_dev_countdown, mDevHitCountdown, mDevHitCountdown),
                            Toast.LENGTH_SHORT);
                    mDevHitToast.show();
                }
            } else if (mDevHitCountdown < 0) {
                if (mDevHitToast != null) {
                    mDevHitToast.cancel();
                }
                mDevHitToast = Toast.makeText(getActivity(), R.string.show_dev_already,
                        Toast.LENGTH_LONG); 
                mDevHitToast.show();
            }
        } 

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

中初始化才会生效:

<resources>
<!-- 是否显示截屏按钮-->
<!-- should show the screenshot button default -->
<bool name="def_screenshot_button_show">true</bool>
<!-- 截屏图片保存位置-->
<!-- the store location of screen capture by default-->
<string name="def_screenshot_location">/mnt/sdcard</string>
<bool name="def_dim_screen">true</bool>
<!-- 屏幕默认休眠时间-->
<integer name="def_screen_off_timeout">60000</integer>

<!-- 飞行模式默认是否打开-->
<bool name="def_airplane_mode_on">false</bool>
<!-- Comma-separated list of bluetooth, wifi, and cell. -->
<string name="def_airplane_mode_radios" translatable="false">cell,bluetooth,wifi,nfc,wimax</string>
<string name="airplane_mode_toggleable_radios" translatable="false">bluetooth,wifi,nfc</string>
<bool name="def_auto_time">true</bool>
<bool name="def_auto_time_zone">true</bool>
<bool name="def_accelerometer_rotation">true</bool>
<!-- 默认屏幕背光-->
<!-- Default screen brightness, from 0 to 255. 102 is 40%. -->
<integer name="def_screen_brightness">102</integer>
<bool name="def_screen_brightness_automatic_mode">false</bool>
<fraction name="def_window_animation_scale">100%</fraction>
<fraction name="def_window_transition_scale">100%</fraction>
<bool name="def_haptic_feedback">true</bool>
<!--蓝牙是否默认打开 -->
<bool name="def_bluetooth_on">false</bool>
<bool name="def_wifi_display_on">false</bool>
<!-- 允许安装未知来源的应用-->
<bool name="def_install_non_market_apps">false</bool>
<bool name="def_package_verifier_enable">true</bool>
<!-- Comma-separated list of location providers.
Network location is off by default because it requires
user opt-in via Setup Wizard or Settings.
-->
<!--M: set gps default is off.-->
<string name="def_location_providers_allowed" translatable="false"></string>
<bool name="assisted_gps_enabled">true</bool>
<bool name="def_netstats_enabled">true</bool>
<bool name="def_usb_mass_storage_enabled">true</bool>
<bool name="def_wifi_on">false</bool>
<!-- 0 == never, 1 == only when plugged in, 2 == always -->
<integer name="def_wifi_sleep_policy">0</integer>
<bool name="def_networks_available_notification_on">true</bool>

<bool name="def_backup_enabled">false</bool>
<!--string name="def_backup_transport" translatable="false">android/com.android.internal.backup.LocalTransport</string-->
<string name="def_backup_transport" translatable="false">com.google.android.backup/.BackupTransportService</string>

<!-- Default value for whether or not to pulse the notification LED when there is a
pending notification -->
<bool name="def_notification_pulse">true</bool>

<bool name="def_mount_play_notification_snd">true</bool>
<bool name="def_mount_ums_autostart">false</bool>
<bool name="def_mount_ums_prompt">true</bool>
<bool name="def_mount_ums_notify_enabled">true</bool>

<!-- user interface sound effects -->
<integer name="def_power_sounds_enabled">1</integer>
<string name="def_low_battery_sound" translatable="false">/system/media/audio/ui/LowBattery.ogg</string>
<integer name="def_dock_sounds_enabled">0</integer>
<string name="def_desk_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string>
<string name="def_desk_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
<string name="def_car_dock_sound" translatable="false">/system/media/audio/ui/Dock.ogg</string>
<string name="def_car_undock_sound" translatable="false">/system/media/audio/ui/Undock.ogg</string>
<integer name="def_lockscreen_sounds_enabled">1</integer>
<string name="def_lock_sound" translatable="false">/system/media/audio/ui/Lock.ogg</string>
<string name="def_unlock_sound" translatable="false">/system/media/audio/ui/Unlock.ogg</string>
<string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>

<bool name="def_lockscreen_disabled">false</bool>
<bool name="def_device_provisioned">false</bool>
<integer name="def_dock_audio_media_enabled">1</integer>

<!-- Notifications use ringer volume -->
<bool name="def_notifications_use_ring_volume">true</bool>

<!-- Default for Settings.System.VIBRATE_IN_SILENT -->
<bool name="def_vibrate_in_silent">true</bool>

<!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION -->
<bool name="def_accessibility_script_injection">false</bool>

<!-- Default for Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD -->
<bool name="def_accessibility_speak_password">false</bool>

<!-- Default for Settings.Secure.ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS -->
<string name="def_accessibility_web_content_key_bindings" translatable="false">
<!-- DPAD/Trackball UP - traverse previous on current axis and send an event. -->
0x13=0x01000100;
<!-- DPAD/Trackball DOWN - traverse next on current axis and send an event. -->
0x14=0x01010100;
<!-- DPAD/Trackball LEFT - traverse previous on the character navigation axis and send event. -->
0x15=0x02000001;
<!-- DPAD/Trackball RIGHT - traverse next on the character navigation axis end send event. -->
0x16=0x02010001;
<!-- Alt+DPAD/Trackball UP - go to the top of the document. -->
0x200000013=0x02000601;
<!-- Alt+DPAD/Trackball DOWN - go to the bottom of the document. -->
0x200000014=0x02010601;
<!-- Alt+DPAD/Trackball LEFT - transition from an axis to another and sends an event.-->
<!-- Axis transitions: 2 -> 1; -->
0x200000015=0x03020101;
<!-- Alt+DPAD/Trackball RIGHT - transition from an axis to another and sends an event. -->
<!-- Axis transitions: 1 -> 2; -->
0x200000016=0x03010201;
<!-- Alt+g - go to the previous heading and send an event. -->
0x200000023=0x02000301;
<!-- Alt+h - go to the next heading and send an event. -->
0x200000024=0x02010301;
<!-- Alt+COMMA - transition to sentence navigation axis and send an event. -->
<!-- Axis transitions: 7 -> 2; -->
0x200000037=0x03070201;
<!-- Alt+PERIOD - transition to default web view behavior axis and send an event. -->
<!-- Axis transitions: 0 -> 7; 1 - > 7; 2 -> 7; -->
0x200000038=0x03000701:0x03010701:0x03020701;
</string>

<!-- Default for Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION_URL -->
<string name="def_accessibility_screen_reader_url" translatable="false">
https://ssl.gstatic.com/accessibility/javascript/android/AndroidVox_v1.js
</string>

<!-- Default for Settings.Secure.TOUCH_EXPLORATION_ENABLED -->
<bool name="def_touch_exploration_enabled">false</bool>

<!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE -->
<fraction name="def_accessibility_display_magnification_scale">200%</fraction>

<!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED -->
<bool name="def_accessibility_display_magnification_enabled">false</bool>

<!-- Default value for Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE -->
<bool name="def_accessibility_display_magnification_auto_update">true</bool>

<!-- Default for Settings.System.USER_ROTATION -->
<integer name="def_user_rotation">0</integer>

<!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
<integer name="def_download_manager_max_bytes_over_mobile">-1</integer>
<!-- Default for Settings.Secure.DOWNLOAD_RECOMMENDED_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
<integer name="def_download_manager_recommended_max_bytes_over_mobile">-1</integer>

<!-- Default for Settings.Secure.LONG_PRESS_TIMEOUT_MILLIS -->
<integer name="def_long_press_timeout_millis">500</integer>

<!-- Default for Settings.System.POINTER_SPEED -->
<integer name="def_pointer_speed">0</integer>

<!-- Default for DTMF tones enabled -->
<bool name="def_dtmf_tones_enabled">true</bool>
<!-- M: Default for UI touch sounds disabled ,google defaulit is enable -->
<bool name="def_sound_effects_enabled">false</bool>

<!-- Development settings -->
<bool name="def_stay_on_while_plugged_in">false</bool>

<!-- Number of retries for connecting to DHCP.
Value here is the same as WifiStateMachine.DEFAULT_MAX_DHCP_RETRIES -->
<integer name="def_max_dhcp_retries">9</integer>

<!-- Default for Settings.Secure.USER_SETUP_COMPLETE -->
<bool name="def_user_setup_complete">false</bool>

<!-- Default for Settings.Global.LOW_BATTERY_SOUND_TIMEOUT.
0 means no timeout; battery sounds will always play
>0 is milliseconds of screen-off time after which battery sounds will not play -->
<integer name="def_low_battery_sound_timeout">0</integer>
</resources>

当然还有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"/>
<!-- <CheckBoxPreference 
android:key="phone_vibrate" 
android:title="@string/vibrate_title"
android:summary="@string/Phone_vibrate_summary"/>-->
<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.setOnSettingsClickListener(mProfileSettingListener);
}

packages/apps/Settings/src/com/medietek/audrioprofile/Editprofile.java private void initPreference() {}中注释以下:  

    //   mVibrat = (CheckBoxPreference) findPreference(KEY_VIBRATE);
    ... ...
       //  mVibrat.setEnabled(false);

还有这里,总之搜索mVibrat的结果都注释掉或者加个判断:

if (!isSmsCapable()) {
// parent.removePreference(mVibrat);
}

private void updatePreference() {
// mVibrat.setChecked(mProfileManager.getVibrationEnabled(mKey));

… …

还有这一大段:

// if (mVibrat != null) {
// final String name = AudioProfileManager.getVibrationKey(mKey);
// Xlog.d(TAG,"name " + name);
// String vibrateEnabled = Settings.System.getString(
// getContentResolver(), name);
// if (vibrateEnabled != null) {
// mVibrat.setChecked("true"
// .equals(vibrateEnabled));
// Xlog.d(TAG,
// "vibrate setting is "
// + "true".equals(vibrateEnabled));
// }
//
// }

还有:

public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
Preference preference) {
Xlog.d(TAG, "Key :" + preference.getKey());
// if ((preference.getKey()).equals(KEY_VIBRATE)) {
// boolean isVibrate = mVibrat.isChecked();
// Xlog.d(TAG, "set vibrate" + isVibrate);
// mProfileManager.setVibrationEnabled(mKey, isVibrate);
// } else



显示设置中增加“永不休眠”功能

首先在frameworks\base\packages\SettingsProvider\res\values\defaults.xml中设置def_screen_off_timeout为-1,即
<integer name=”def_screen_off_timeout”>-1</integer>
然后修改alps\packages\apps\Settings\res\values\arrays.xml:

 <!-- Display settings.  The delay in inactivity before the screen is turned off. These are shown ain a list dialog. -->
    <string-array name="screen_timeout_entries">
        <item>15 seconds</item>
        <item>30 seconds</item>
        <item>1 minute</item>
        <item>2 minutes</item>
        <item>10 minutes</item>
        <item>30 minutes</item>
        <item>never</item>
    </string-array>
 
    <!-- Do not translate. -->
   <string-array  name="screen_timeout_values" translatable="false">
        <!-- Do not translate. -->
        <item>15000</item>
        <!-- Do not translate. -->
        <item>30000</item>
        <!-- Do not translate. -->
        <item>60000</item>
        <!-- Do not translate. -->
        <item>120000</item>
        <!-- Do not translate. -->
        <item>600000</item>
        <!-- Do not translate. -->
        <item>1800000</item>
         <item>-1</item>
    </string-array>

接着修改对比语言value文件夹下的arrays.xml, 修改screen_timeout_entries对应的翻译。不用管那个msgid,只是google用来表示是他自己的资源而已,直接添加<item >”永不休眠”</item>即可。

然后是代码的改动:

frameworks/base/services/java/com/android/server/power/PowerManagerService.java

private void updateUserActivitySummaryLocked(long now, int dirty) {
.....
 
//change code here ==============
                      Slog.d(TAG,"mScreenOffTimeoutSetting ="+mScreenOffTimeoutSetting);
                      //if (mUserActivitySummary != 0 ) {
                if (mUserActivitySummary != 0 && mScreenOffTimeoutSetting > 0) {
//change code here  end ==============
                    Message msg = mHandler.obtainMessage(MSG_USER_ACTIVITY_TIMEOUT);
                    msg.setAsynchronous(true);
                    mHandler.sendMessageAtTime(msg, nextTimeout);
                }

Android修改应用的默认安装位置

Google默认的PackageManager,会读取应用AndroidManifest.xml的对应定义

installLocation规则如下:

1.如果没有定义安装位置,表示安装在手机内存上;

2.android:installLocation =”auto” :先查看手机内存是否足够,如果够就安装在手机内存上,不够就安装在T 卡上;

3.android:installLocation = “internalOnly”:表示安装在手机内存上;

4.android:installLocation = “preferExternal”:表示安装在 T 卡上;

如何在设置中增加“选取应用安装位置”的功能,让用户选择默认的安装位置?

修改如下文件:frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

loadSetting(stmt, Global.SET_INSTALL_LOCATION, 0);


改为:

loadSetting(stmt, Secure.SET_INSTALL_LOCATION, 1);

并将

loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 0);

改为:

loadSetting(stmt, Settings.Secure.SET_INSTALL_LOCATION, 1);

这样修改之后,在设置>应用中会出现“选取应用安装位置”的功能,不过无论在这里选择什么,对于应用中AndroidManifest.xml文件中声明

android:installLocation = "internalOnly"

的,该apk 都会安装到手机上,这样做的好处是避免程序运行错误,因为定义android:installLocation = “internalOnly” 的 apk 一般要安装到手机内存上才能正常运行。


默认输入法勾选多国语言,并默认其中一种语言

1.首先在设备上调整输入法

设置>语言输入法>Android键盘(AOSP),在输入语言里勾选要选择的语言,比如选“英语(美国)”和“西班牙文”两种:

《Android Settings和SettingsProvider源码分析与修改》

2.选择系统输入法的默认语言(默认为两种语言中的“西班牙文”)

打开一个能能调出输入法的应用,下拉通知栏里,“选择输入法”调整为“西班牙文”

《Android Settings和SettingsProvider源码分析与修改》

3.查看Setting数据库文件

adb pull data/data/com.android.providers.settings/databases/settings.db C:\

打开Secure表,查看default_input_method,enabled_input_methods和selected_input_method_subtype三个字段内容,并记录:

《Android Settings和SettingsProvider源码分析与修改》

default_input_method       com.android.inputmethod.latin/.LatinIME

enabled_input_methods    com.android.inputmethod.latin/.LatinIME;816242702;-921088104

selected_input_method_subtype    816242702

4.修改SettingsProvider文件

frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

将函数private void loadSecureSettings(SQLiteDatabase db) 中的以下两行(注意是loadSecureSettings函数,不是loadSystemSettings):

           

 loadSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS, defaultIme);
            loadSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD, defaultIme);

修改为以下三行:

loadSetting(stmt, Settings.Secure.ENABLED_INPUT_METHODS,"com.android.inputmethod.latin/.LatinIME;816242702;-921088104");//选中的输入法
loadSetting(stmt, Settings.Secure.DEFAULT_INPUT_METHOD, "com.android.inputmethod.latin/.LatinIME");// 默认输入法为系统输入法
loadSetting(stmt, Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, "816242702"); // 默认输入法的默认语言

android.provider.Settings的Secure和System常量

android.provider.Settings.Secure常量

String ACCESSIBILITY_DISPLAY_INVERSION_ENABLEDSetting that specifies whether display color inversion is enabled.

String
ACCESSIBILITY_ENABLED
If accessibility is enabled.

String
ACCESSIBILITY_SPEAK_PASSWORD
Whether to speak passwords while in accessibility mode.

String
ADB_ENABLED
This constant was deprecated in API level 17. Use ADB_ENABLED instead

String
ALLOWED_GEOLOCATION_ORIGINS
Origins for which browsers should allow geolocation by default.

String
ALLOW_MOCK_LOCATION
Setting to allow mock locations and location provider status to be injected into the LocationManager service for testing purposes during application development.

String
ANDROID_ID
A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user’s device.

String
BACKGROUND_DATA
This constant was deprecated in API level 14. As of ICE_CREAM_SANDWICH, availability of background data depends on several combined factors. When background data is unavailable, getActiveNetworkInfo() will now appear disconnected.

String
BLUETOOTH_ON
This constant was deprecated in API level 17. Use BLUETOOTH_ON instead

String
DATA_ROAMING
This constant was deprecated in API level 17. Use DATA_ROAMING instead

String
DEFAULT_INPUT_METHOD
Setting to record the input method used by default, holding the ID of the desired method.

String
DEVELOPMENT_SETTINGS_ENABLED
This constant was deprecated in API level 17. Use DEVELOPMENT_SETTINGS_ENABLED instead

String
DEVICE_PROVISIONED
This constant was deprecated in API level 17. Use DEVICE_PROVISIONED instead

String
ENABLED_ACCESSIBILITY_SERVICES
List of the enabled accessibility providers.

String
ENABLED_INPUT_METHODS
List of input methods that are currently enabled.

String
HTTP_PROXY
This constant was deprecated in API level 17. Use HTTP_PROXY

String
INPUT_METHOD_SELECTOR_VISIBILITY
Setting to record the visibility of input method selector

String
INSTALL_NON_MARKET_APPS
Whether applications can be installed for this user via the system’s ACTION_INSTALL_PACKAGE mechanism.

String
LOCATION_MODE
The degree of location access enabled by the user.

int
LOCATION_MODE_BATTERY_SAVING
Reduced power usage, such as limiting the number of GPS updates per hour.

int
LOCATION_MODE_HIGH_ACCURACY
Best-effort location computation allowed.

int
LOCATION_MODE_OFF
Location access disabled.

int
LOCATION_MODE_SENSORS_ONLY
Network Location Provider disabled, but GPS and other sensors enabled.

String
LOCATION_PROVIDERS_ALLOWED
This constant was deprecated in API level 19. use LOCATION_MODE and MODE_CHANGED_ACTION (or PROVIDERS_CHANGED_ACTION)

String
LOCK_PATTERN_ENABLED
Whether autolock is enabled (0 = false, 1 = true)

String
LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED
This constant was deprecated in API level 17. Starting in JELLY_BEAN_MR1 the lockscreen uses HAPTIC_FEEDBACK_ENABLED.

String
LOCK_PATTERN_VISIBLE
Whether lock pattern is visible as user enters (0 = false, 1 = true)

String
LOGGING_ID
This constant was deprecated in API level 3. This identifier is poorly initialized and has many collisions. It should not be used. 

String
NETWORK_PREFERENCE
This constant was deprecated in API level 17. Use NETWORK_PREFERENCE instead

String
PARENTAL_CONTROL_ENABLED
No longer supported.

String
PARENTAL_CONTROL_LAST_UPDATE
No longer supported.

String
PARENTAL_CONTROL_REDIRECT_URL
No longer supported.

String
SELECTED_INPUT_METHOD_SUBTYPE
Setting to record the input method subtype used by default, holding the ID of the desired method.

String
SETTINGS_CLASSNAME
Settings classname to launch when Settings is clicked from All Applications.

String
SYS_PROP_SETTING_VERSION
 

String
TOUCH_EXPLORATION_ENABLED
If touch exploration is enabled.

String
TTS_DEFAULT_COUNTRY
This constant was deprecated in API level 14. this setting is no longer in use, as of the Ice Cream Sandwich release. Apps should never need to read this setting directly, instead can query the TextToSpeech framework classes for the default locale. getLanguage().

String
TTS_DEFAULT_LANG
This constant was deprecated in API level 14. this setting is no longer in use, as of the Ice Cream Sandwich release. Apps should never need to read this setting directly, instead can query the TextToSpeech framework classes for the default locale. getLanguage().

String
TTS_DEFAULT_PITCH
Default text-to-speech engine pitch.

String
TTS_DEFAULT_RATE
Default text-to-speech engine speech rate.

String
TTS_DEFAULT_SYNTH
Default text-to-speech engine.

String
TTS_DEFAULT_VARIANT
This constant was deprecated in API level 14. this setting is no longer in use, as of the Ice Cream Sandwich release. Apps should never need to read this setting directly, instead can query the TextToSpeech framework classes for the locale that is in use getLanguage().

String
TTS_ENABLED_PLUGINS
Space delimited list of plugin packages that are enabled.

String
TTS_USE_DEFAULTS
This constant was deprecated in API level 14. The value of this setting is no longer respected by the framework text to speech APIs as of the Ice Cream Sandwich release.

String
USB_MASS_STORAGE_ENABLED
This constant was deprecated in API level 17. Use USB_MASS_STORAGE_ENABLED instead

String
USE_GOOGLE_MAIL
This constant was deprecated in API level 17. Use USE_GOOGLE_MAIL instead

String
WIFI_MAX_DHCP_RETRY_COUNT
This constant was deprecated in API level 17. Use WIFI_MAX_DHCP_RETRY_COUNT instead

String
WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS
This constant was deprecated in API level 17. Use WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS instead

String
WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON
This constant was deprecated in API level 17. Use WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON instead.

String
WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY
This constant was deprecated in API level 17. Use WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY instead.

String
WIFI_NUM_OPEN_NETWORKS_KEPT
This constant was deprecated in API level 17. Use WIFI_NUM_OPEN_NETWORKS_KEPT instead.

String
WIFI_ON
This constant was deprecated in API level 17. Use WIFI_ON instead.

String
WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_AP_COUNT
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_MAX_AP_CHECKS
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_ON
This constant was deprecated in API level 17. Use WIFI_WATCHDOG_ON instead

String
WIFI_WATCHDOG_PING_COUNT
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_PING_DELAY_MS
This constant was deprecated in API level 14. This setting is not used.

String
WIFI_WATCHDOG_PING_TIMEOUT_MS
This constant was deprecated in API level 14. This setting is not used.

String WIFI_WATCHDOG_WATCH_LISTThis constant was deprecated in API level 14. This setting is not used.

————————————————————————————————————————————————————————————

android.provider.Settings.System常量

StringACCELEROMETER_ROTATIONControl whether the accelerometer will be used to change screen orientation.
StringADB_ENABLEDThis constant was deprecated in API level 3. Use ADB_ENABLED instead
StringAIRPLANE_MODE_ONThis constant was deprecated in API level 17. Use AIRPLANE_MODE_ON instead
StringAIRPLANE_MODE_RADIOSThis constant was deprecated in API level 17. Use AIRPLANE_MODE_RADIOS instead
StringALARM_ALERTPersistent store for the system-wide default alarm alert.
StringALWAYS_FINISH_ACTIVITIESThis constant was deprecated in API level 17. Use ALWAYS_FINISH_ACTIVITIES instead
StringANDROID_IDThis constant was deprecated in API level 3. Use ANDROID_ID instead
StringANIMATOR_DURATION_SCALEThis constant was deprecated in API level 17. Use ANIMATOR_DURATION_SCALE instead
StringAPPEND_FOR_LAST_AUDIBLEAppended to various volume related settings to record the previous values before they the settings were affected by a silent/vibrate ringer mode change.
StringAUTO_TIMEThis constant was deprecated in API level 17. Use AUTO_TIME instead
StringAUTO_TIME_ZONEThis constant was deprecated in API level 17. Use AUTO_TIME_ZONE instead
StringBLUETOOTH_DISCOVERABILITYDetermines whether remote devices may discover and/or connect to this device.
StringBLUETOOTH_DISCOVERABILITY_TIMEOUTBluetooth discoverability timeout.
StringBLUETOOTH_ONThis constant was deprecated in API level 3. Use BLUETOOTH_ON instead
StringDATA_ROAMINGThis constant was deprecated in API level 3. Use DATA_ROAMING instead
StringDATE_FORMATDate format string mm/dd/yyyy dd/mm/yyyy yyyy/mm/dd
StringDEBUG_APPThis constant was deprecated in API level 17. Use DEBUG_APP instead
StringDEVICE_PROVISIONEDThis constant was deprecated in API level 3. Use DEVICE_PROVISIONED instead
StringDIM_SCREENThis constant was deprecated in API level 17. This setting is no longer used.
StringDTMF_TONE_WHEN_DIALINGWhether the audible DTMF tones are played by the dialer when dialing.
StringEND_BUTTON_BEHAVIORWhat happens when the user presses the end call button if they’re not on a call.
StringFONT_SCALEScaling factor for fonts, float.
StringHAPTIC_FEEDBACK_ENABLEDWhether the haptic feedback (long presses, …) are enabled.
StringHTTP_PROXYThis constant was deprecated in API level 3. Use HTTP_PROXY instead
StringINSTALL_NON_MARKET_APPSThis constant was deprecated in API level 3. Use INSTALL_NON_MARKET_APPS instead
StringLOCATION_PROVIDERS_ALLOWEDThis constant was deprecated in API level 3. Use LOCATION_PROVIDERS_ALLOWED instead
StringLOCK_PATTERN_ENABLEDThis constant was deprecated in API level 8. Use LOCK_PATTERN_ENABLED instead
StringLOCK_PATTERN_TACTILE_FEEDBACK_ENABLEDThis constant was deprecated in API level 8. Use LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED instead
StringLOCK_PATTERN_VISIBLEThis constant was deprecated in API level 8. Use LOCK_PATTERN_VISIBLE instead
StringLOGGING_IDThis constant was deprecated in API level 3. Use LOGGING_ID instead
StringMODE_RINGERThis constant was deprecated in API level 17. Use MODE_RINGER instead
StringMODE_RINGER_STREAMS_AFFECTEDDetermines which streams are affected by ringer mode changes.
StringMUTE_STREAMS_AFFECTEDDetermines which streams are affected by mute.
StringNETWORK_PREFERENCEThis constant was deprecated in API level 3. Use NETWORK_PREFERENCE instead
StringNEXT_ALARM_FORMATTEDA formatted string of the next alarm that is set, or the empty string if there is no alarm set.
StringNOTIFICATION_SOUNDPersistent store for the system-wide default notification sound.
StringPARENTAL_CONTROL_ENABLEDThis constant was deprecated in API level 3. Use PARENTAL_CONTROL_ENABLED instead
StringPARENTAL_CONTROL_LAST_UPDATEThis constant was deprecated in API level 3. Use PARENTAL_CONTROL_LAST_UPDATE instead
StringPARENTAL_CONTROL_REDIRECT_URLThis constant was deprecated in API level 3. Use PARENTAL_CONTROL_REDIRECT_URL instead
StringRADIO_BLUETOOTHThis constant was deprecated in API level 17. Use RADIO_BLUETOOTH instead
StringRADIO_CELLThis constant was deprecated in API level 17. Use RADIO_CELL instead
StringRADIO_NFCThis constant was deprecated in API level 17. Use RADIO_NFC instead
StringRADIO_WIFIThis constant was deprecated in API level 17. Use RADIO_WIFI instead
StringRINGTONEPersistent store for the system-wide default ringtone URI.
StringSCREEN_BRIGHTNESSThe screen backlight brightness between 0 and 255.
StringSCREEN_BRIGHTNESS_MODEControl whether to enable automatic brightness mode.
intSCREEN_BRIGHTNESS_MODE_AUTOMATICSCREEN_BRIGHTNESS_MODE value for automatic mode.
intSCREEN_BRIGHTNESS_MODE_MANUALSCREEN_BRIGHTNESS_MODE value for manual mode.
StringSCREEN_OFF_TIMEOUTThe timeout before the screen turns off.
StringSETTINGS_CLASSNAMEThis constant was deprecated in API level 3. Use SETTINGS_CLASSNAME instead
StringSETUP_WIZARD_HAS_RUNWhether the setup wizard has been run before (on first boot), or if it still needs to be run.
StringSHOW_GTALK_SERVICE_STATUS 
StringSHOW_PROCESSESThis constant was deprecated in API level 17. Use SHOW_PROCESSES instead
StringSHOW_WEB_SUGGESTIONSThis constant was deprecated in API level 11. Each application that shows web suggestions should have its own setting for this.
StringSOUND_EFFECTS_ENABLEDWhether the sounds effects (key clicks, lid open …) are enabled.
StringSTAY_ON_WHILE_PLUGGED_INThis constant was deprecated in API level 17. Use STAY_ON_WHILE_PLUGGED_IN instead
StringSYS_PROP_SETTING_VERSION 
StringTEXT_AUTO_CAPSSetting to enable Auto Caps in text editors.
StringTEXT_AUTO_PUNCTUATESetting to enable Auto Punctuate in text editors.
StringTEXT_AUTO_REPLACESetting to enable Auto Replace (AutoText) in text editors.
StringTEXT_SHOW_PASSWORDSetting to showing password characters in text editors.
StringTIME_12_24Display times as 12 or 24 hours 12 24
StringTRANSITION_ANIMATION_SCALEThis constant was deprecated in API level 17. Use TRANSITION_ANIMATION_SCALE instead
StringUSB_MASS_STORAGE_ENABLEDThis constant was deprecated in API level 3. Use USB_MASS_STORAGE_ENABLED instead
StringUSER_ROTATIONDefault screen rotation when no other policy applies.
StringUSE_GOOGLE_MAILThis constant was deprecated in API level 3. Use USE_GOOGLE_MAIL instead
StringVIBRATE_ONWhether vibrate is on for different events.
StringVOLUME_ALARMAlarm volume.
StringVOLUME_BLUETOOTH_SCOBluetooth Headset volume.
StringVOLUME_MUSICMusic/media/gaming volume.
StringVOLUME_NOTIFICATIONNotification volume.
StringVOLUME_RINGRinger volume.
StringVOLUME_SYSTEMSystem/notifications volume.
StringVOLUME_VOICEVoice call volume.
StringWAIT_FOR_DEBUGGERThis constant was deprecated in API level 17. Use WAIT_FOR_DEBUGGER instead
StringWALLPAPER_ACTIVITYThis constant was deprecated in API level 17. Use WallpaperManager instead.
StringWIFI_MAX_DHCP_RETRY_COUNTThis constant was deprecated in API level 3. Use WIFI_MAX_DHCP_RETRY_COUNT instead
StringWIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MSThis constant was deprecated in API level 3. Use WIFI_MOBILE_DATA_TRANSITION_WAKELOCK_TIMEOUT_MS instead
StringWIFI_NETWORKS_AVAILABLE_NOTIFICATION_ONThis constant was deprecated in API level 3. Use WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON instead
StringWIFI_NETWORKS_AVAILABLE_REPEAT_DELAYThis constant was deprecated in API level 3. Use WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY instead
StringWIFI_NUM_OPEN_NETWORKS_KEPTThis constant was deprecated in API level 3. Use WIFI_NUM_OPEN_NETWORKS_KEPT instead
StringWIFI_ONThis constant was deprecated in API level 3. Use WIFI_ON instead
StringWIFI_SLEEP_POLICYThis constant was deprecated in API level 17. Use WIFI_SLEEP_POLICY instead
intWIFI_SLEEP_POLICY_DEFAULTThis constant was deprecated in API level 17. Use WIFI_SLEEP_POLICY_DEFAULT instead
intWIFI_SLEEP_POLICY_NEVERThis constant was deprecated in API level 17. Use WIFI_SLEEP_POLICY_NEVER instead
intWIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGEDThis constant was deprecated in API level 17. Use WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED instead
StringWIFI_STATIC_DNS1This constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_STATIC_DNS2This constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_STATIC_GATEWAYThis constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_STATIC_IPThis constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_STATIC_NETMASKThis constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_USE_STATIC_IPThis constant was deprecated in API level 17. Use WifiManager instead
StringWIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGEThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_ACCEPTABLE_PACKET_LOSS_PERCENTAGE instead
StringWIFI_WATCHDOG_AP_COUNTThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_AP_COUNT instead
StringWIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MSThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_BACKGROUND_CHECK_DELAY_MS instead
StringWIFI_WATCHDOG_BACKGROUND_CHECK_ENABLEDThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_BACKGROUND_CHECK_ENABLED instead
StringWIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MSThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_BACKGROUND_CHECK_TIMEOUT_MS instead 
StringWIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNTThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_INITIAL_IGNORED_PING_COUNT instead
StringWIFI_WATCHDOG_MAX_AP_CHECKSThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_MAX_AP_CHECKS instead
StringWIFI_WATCHDOG_ONThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_ON instead
StringWIFI_WATCHDOG_PING_COUNTThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_PING_COUNT instead
StringWIFI_WATCHDOG_PING_DELAY_MSThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_PING_DELAY_MS instead
StringWIFI_WATCHDOG_PING_TIMEOUT_MSThis constant was deprecated in API level 3. Use WIFI_WATCHDOG_PING_TIMEOUT_MS instead
StringWINDOW_ANIMATION_SCALEThis constant was deprecated in API level 17. Use WINDOW_ANIMATION_SCALE instead 

转载请注明出处:周木水的CSDN博客 http://blog.csdn.net/zhoumushui

    原文作者:Android源码分析
    原文地址: https://blog.csdn.net/zhoumushui/article/details/40051331
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞