6.0的充电提示音现在看来是无线充电的充电提示音,插入电源或usb进行充电,目前代码中并未有相关插入充电提示音的代码
移除无线充电提示音设置项,以免误认为是插入充电的提示音
OtherSoundSettings.java
字符串:charging_sounds_title
字符串引用:
packages/apps/Settings/res/xml/other_sound_settings.xml
java文件引用:
packages/apps/Settings/src/com/android/settings/notification/OtherSoundSettings.java CHARGING_SOUNDS_ENABLED
frameworks/base/services/core/java/com/android/server/power/Notifier.java: Settings.Global.CHARGING_SOUNDS_ENABLED, 1) != 0;
private void playWirelessChargingStartedSound() {
final boolean enabled = Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.CHARGING_SOUNDS_ENABLED, 1) != 0;
final String soundPath = Settings.Global.getString(mContext.getContentResolver(),
Settings.Global.WIRELESS_CHARGING_STARTED_SOUND);
if (enabled && soundPath != null) {
final Uri soundUri = Uri.parse("file://" + soundPath);
if (soundUri != null) {
final Ringtone sfx = RingtoneManager.getRingtone(mContext, soundUri);
if (sfx != null) {
sfx.setStreamType(AudioManager.STREAM_SYSTEM);
sfx.play();
}
}
}
mSuspendBlocker.release();
}
frameworks/base/core/java/android/provider/Settings.java: public static final String CHARGING_SOUNDS_ENABLED = "charging_sounds_enabled";
frameworks/base/core/java/android/provider/Settings.java: CHARGING_SOUNDS_ENABLED,
./packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java: loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
./packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java: loadStringSetting(stmt, Settings.Global.WIRELESS_CHARGING_STARTED_SOUND,
./packages/SettingsProvider/res/values/defaults.xml: <string name="def_wireless_charging_started_sound" translatable="false">/system/media/audio/ui/WirelessChargingStarted.ogg</string>