am 89889733: Merge change I4e83a76a into eclair
Merge commit '898897338dfd62a268a89fb55ee900a9bd5a683f' into eclair-mr2 * commit '898897338dfd62a268a89fb55ee900a9bd5a683f': Fix bug 2201417. Whenever the System setting that indicates
This commit is contained in:
@@ -959,10 +959,10 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public class VolumeStreamState {
|
public class VolumeStreamState {
|
||||||
private final String mVolumeIndexSettingName;
|
|
||||||
private final String mLastAudibleVolumeIndexSettingName;
|
|
||||||
private final int mStreamType;
|
private final int mStreamType;
|
||||||
|
|
||||||
|
private String mVolumeIndexSettingName;
|
||||||
|
private String mLastAudibleVolumeIndexSettingName;
|
||||||
private int mIndexMax;
|
private int mIndexMax;
|
||||||
private int mIndex;
|
private int mIndex;
|
||||||
private int mLastAudibleIndex;
|
private int mLastAudibleIndex;
|
||||||
@@ -970,8 +970,7 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
|
|
||||||
private VolumeStreamState(String settingName, int streamType) {
|
private VolumeStreamState(String settingName, int streamType) {
|
||||||
|
|
||||||
mVolumeIndexSettingName = settingName;
|
setVolumeIndexSettingName(settingName);
|
||||||
mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;
|
|
||||||
|
|
||||||
mStreamType = streamType;
|
mStreamType = streamType;
|
||||||
|
|
||||||
@@ -991,6 +990,11 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
mDeathHandlers = new ArrayList<VolumeDeathHandler>();
|
mDeathHandlers = new ArrayList<VolumeDeathHandler>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setVolumeIndexSettingName(String settingName) {
|
||||||
|
mVolumeIndexSettingName = settingName;
|
||||||
|
mLastAudibleVolumeIndexSettingName = settingName + System.APPEND_FOR_LAST_AUDIBLE;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean adjustIndex(int deltaIndex) {
|
public boolean adjustIndex(int deltaIndex) {
|
||||||
return setIndex(mIndex + deltaIndex * 10, true);
|
return setIndex(mIndex + deltaIndex * 10, true);
|
||||||
}
|
}
|
||||||
@@ -1370,11 +1374,17 @@ public class AudioService extends IAudioService.Stub {
|
|||||||
mNotificationsUseRingVolume = notificationsUseRingVolume;
|
mNotificationsUseRingVolume = notificationsUseRingVolume;
|
||||||
if (mNotificationsUseRingVolume == 1) {
|
if (mNotificationsUseRingVolume == 1) {
|
||||||
STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING;
|
STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_RING;
|
||||||
|
mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(
|
||||||
|
System.VOLUME_SETTINGS[AudioSystem.STREAM_RING]);
|
||||||
} else {
|
} else {
|
||||||
STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION;
|
STREAM_VOLUME_ALIAS[AudioSystem.STREAM_NOTIFICATION] = AudioSystem.STREAM_NOTIFICATION;
|
||||||
|
mStreamStates[AudioSystem.STREAM_NOTIFICATION].setVolumeIndexSettingName(
|
||||||
|
System.VOLUME_SETTINGS[AudioSystem.STREAM_NOTIFICATION]);
|
||||||
// Persist notification volume volume as it was not persisted while aliased to ring volume
|
// Persist notification volume volume as it was not persisted while aliased to ring volume
|
||||||
|
// and persist with no delay as there might be registered observers of the persisted
|
||||||
|
// notification volume.
|
||||||
sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, AudioSystem.STREAM_NOTIFICATION,
|
sendMsg(mAudioHandler, MSG_PERSIST_VOLUME, AudioSystem.STREAM_NOTIFICATION,
|
||||||
SENDMSG_REPLACE, 0, 0, mStreamStates[AudioSystem.STREAM_NOTIFICATION], PERSIST_DELAY);
|
SENDMSG_REPLACE, 0, 0, mStreamStates[AudioSystem.STREAM_NOTIFICATION], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user