Merge "Separate notification/ring volume sliders in UI" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
1387d8d4ac
@@ -159,6 +159,7 @@ interface INotificationManager
|
|||||||
void clearRequestedListenerHints(in INotificationListener token);
|
void clearRequestedListenerHints(in INotificationListener token);
|
||||||
void requestHintsFromListener(in INotificationListener token, int hints);
|
void requestHintsFromListener(in INotificationListener token, int hints);
|
||||||
int getHintsFromListener(in INotificationListener token);
|
int getHintsFromListener(in INotificationListener token);
|
||||||
|
int getHintsFromListenerNoToken();
|
||||||
void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
|
void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
|
||||||
int getInterruptionFilterFromListener(in INotificationListener token);
|
int getInterruptionFilterFromListener(in INotificationListener token);
|
||||||
void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
|
void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
|
|||||||
private final int mMaxStreamVolume;
|
private final int mMaxStreamVolume;
|
||||||
private boolean mAffectedByRingerMode;
|
private boolean mAffectedByRingerMode;
|
||||||
private boolean mNotificationOrRing;
|
private boolean mNotificationOrRing;
|
||||||
|
private final boolean mNotifAliasRing;
|
||||||
private final Receiver mReceiver = new Receiver();
|
private final Receiver mReceiver = new Receiver();
|
||||||
|
|
||||||
private Handler mHandler;
|
private Handler mHandler;
|
||||||
@@ -179,6 +180,8 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
|
|||||||
if (mNotificationOrRing) {
|
if (mNotificationOrRing) {
|
||||||
mRingerMode = mAudioManager.getRingerModeInternal();
|
mRingerMode = mAudioManager.getRingerModeInternal();
|
||||||
}
|
}
|
||||||
|
mNotifAliasRing = mContext.getResources().getBoolean(
|
||||||
|
com.android.internal.R.bool.config_alias_ring_notif_stream_types);
|
||||||
mZenMode = mNotificationManager.getZenMode();
|
mZenMode = mNotificationManager.getZenMode();
|
||||||
|
|
||||||
if (hasAudioProductStrategies()) {
|
if (hasAudioProductStrategies()) {
|
||||||
@@ -280,7 +283,15 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
|
|||||||
if (zenMuted) {
|
if (zenMuted) {
|
||||||
mSeekBar.setProgress(mLastAudibleStreamVolume, true);
|
mSeekBar.setProgress(mLastAudibleStreamVolume, true);
|
||||||
} else if (mNotificationOrRing && mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
|
} else if (mNotificationOrRing && mRingerMode == AudioManager.RINGER_MODE_VIBRATE) {
|
||||||
|
/**
|
||||||
|
* the first variable above is preserved and the conditions below are made explicit
|
||||||
|
* so that when user attempts to slide the notification seekbar out of vibrate the
|
||||||
|
* seekbar doesn't wrongly snap back to 0 when the streams aren't aliased
|
||||||
|
*/
|
||||||
|
if (mNotifAliasRing || mStreamType == AudioManager.STREAM_RING
|
||||||
|
|| (mStreamType == AudioManager.STREAM_NOTIFICATION && mMuted)) {
|
||||||
mSeekBar.setProgress(0, true);
|
mSeekBar.setProgress(0, true);
|
||||||
|
}
|
||||||
} else if (mMuted) {
|
} else if (mMuted) {
|
||||||
mSeekBar.setProgress(0, true);
|
mSeekBar.setProgress(0, true);
|
||||||
} else {
|
} else {
|
||||||
@@ -354,6 +365,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
|
|||||||
// set the time of stop volume
|
// set the time of stop volume
|
||||||
if ((mStreamType == AudioManager.STREAM_VOICE_CALL
|
if ((mStreamType == AudioManager.STREAM_VOICE_CALL
|
||||||
|| mStreamType == AudioManager.STREAM_RING
|
|| mStreamType == AudioManager.STREAM_RING
|
||||||
|
|| (!mNotifAliasRing && mStreamType == AudioManager.STREAM_NOTIFICATION)
|
||||||
|| mStreamType == AudioManager.STREAM_ALARM)) {
|
|| mStreamType == AudioManager.STREAM_ALARM)) {
|
||||||
sStopVolumeTime = java.lang.System.currentTimeMillis();
|
sStopVolumeTime = java.lang.System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
@@ -631,8 +643,8 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateVolumeSlider(int streamType, int streamValue) {
|
private void updateVolumeSlider(int streamType, int streamValue) {
|
||||||
final boolean streamMatch = mNotificationOrRing ? isNotificationOrRing(streamType)
|
final boolean streamMatch = mNotifAliasRing && mNotificationOrRing
|
||||||
: (streamType == mStreamType);
|
? isNotificationOrRing(streamType) : streamType == mStreamType;
|
||||||
if (mSeekBar != null && streamMatch && streamValue != -1) {
|
if (mSeekBar != null && streamMatch && streamValue != -1) {
|
||||||
final boolean muted = mAudioManager.isStreamMute(mStreamType)
|
final boolean muted = mAudioManager.isStreamMute(mStreamType)
|
||||||
|| streamValue == 0;
|
|| streamValue == 0;
|
||||||
|
|||||||
@@ -4867,6 +4867,13 @@ public class NotificationManagerService extends SystemService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getHintsFromListenerNoToken() {
|
||||||
|
synchronized (mNotificationLock) {
|
||||||
|
return mListenerHints;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void requestInterruptionFilterFromListener(INotificationListener token,
|
public void requestInterruptionFilterFromListener(INotificationListener token,
|
||||||
int interruptionFilter) throws RemoteException {
|
int interruptionFilter) throws RemoteException {
|
||||||
|
|||||||
Reference in New Issue
Block a user