services/core/java/com/android/server/notification/NotificationManagerService.java
} else if (action.equals(Intent.ACTION_USER_UNLOCKED)) {
final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, USER_NULL);
mConditionProviders.onUserUnlocked(user);
mListeners.onUserUnlocked(user);
mAssistants.onUserUnlocked(user);
mZenModeHelper.onUserUnlocked(user);
//added start
} else if (action.equals(Intent.ACTION_POWER_CONNECTED)) {
final boolean enabled = Settings.Global.getInt(getContext().getContentResolver(),
Settings.Global.CHARGING_SOUNDS_ENABLED, 1) != 0;
final String soundPath = Settings.Global.getString(getContext().getContentResolver(),
Settings.Global.WIRELESS_CHARGING_STARTED_SOUND);
if (enabled && soundPath != null) {
final Uri soundUri = Uri.parse("file://" + soundPath);
if (soundUri != null) {
final Ringtone rt = RingtoneManager.getRingtone(getContext(), soundUri);
if (rt != null) {
rt.setStreamType(AudioManager.STREAM_SYSTEM);
rt.play();
}
}
}
}
//added end
filter.addAction(Intent.ACTION_POWER_CONNECTED);//added