Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1894,6 +1894,9 @@ STREAM_MUSIC as if it's on TV platform. --> <bool name="config_single_volume">false</bool> <!-- Flag indicating whether the volume panel should show remote sessions. --> <bool name="config_volumeShowRemoteSessions">true</bool> <!-- Flag indicating that an outbound call must have a call capable phone account that has declared it can process the call's handle. --> <bool name="config_requireCallCapableAccountForHandle">false</bool> Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4408,4 +4408,6 @@ <java-symbol type="integer" name="config_hotwordDetectedResultMaxBundleSize" /> <java-symbol type="dimen" name="config_wallpaperDimAmount" /> <java-symbol type="bool" name="config_volumeShowRemoteSessions" /> </resources> packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java +74 −58 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa private final MediaSessions mMediaSessions; protected C mCallbacks = new C(); private final State mState = new State(); protected final MediaSessionsCallbacks mMediaSessionsCallbacksW = new MediaSessionsCallbacks(); protected final MediaSessionsCallbacks mMediaSessionsCallbacksW; private final Optional<Vibrator> mVibrator; private final boolean mHasVibrator; private boolean mShowA11yStream; Loading Loading @@ -179,6 +179,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mWorkerLooper = theadFactory.buildLooperOnNewThread( VolumeDialogControllerImpl.class.getSimpleName()); mWorker = new W(mWorkerLooper); mMediaSessionsCallbacksW = new MediaSessionsCallbacks(mContext); mMediaSessions = createMediaSessions(mContext, mWorkerLooper, mMediaSessionsCallbacksW); mAudio = audioManager; mNoMan = notificationManager; Loading Loading @@ -1148,16 +1149,24 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa private final HashMap<Token, Integer> mRemoteStreams = new HashMap<>(); private int mNextStream = DYNAMIC_STREAM_START_INDEX; private final boolean mShowRemoteSessions; public MediaSessionsCallbacks(Context context) { mShowRemoteSessions = context.getResources().getBoolean( com.android.internal.R.bool.config_volumeShowRemoteSessions); } @Override public void onRemoteUpdate(Token token, String name, PlaybackInfo pi) { if (mShowRemoteSessions) { addStream(token, "onRemoteUpdate"); int stream = 0; synchronized (mRemoteStreams) { stream = mRemoteStreams.get(token); } Slog.d(TAG, "onRemoteUpdate: stream: " + stream + " volume: " + pi.getCurrentVolume()); Slog.d(TAG, "onRemoteUpdate: stream: " + stream + " volume: " + pi.getCurrentVolume()); boolean changed = mState.states.indexOfKey(stream) < 0; final StreamState ss = streamStateW(stream); ss.dynamic = true; Loading @@ -1177,9 +1186,11 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mCallbacks.onStateChanged(mState); } } } @Override public void onRemoteVolumeChanged(Token token, int flags) { if (mShowRemoteSessions) { addStream(token, "onRemoteVolumeChanged"); int stream = 0; synchronized (mRemoteStreams) { Loading @@ -1199,9 +1210,11 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mCallbacks.onShowRequested(Events.SHOW_REASON_REMOTE_VOLUME_CHANGED); } } } @Override public void onRemoteRemoved(Token token) { if (mShowRemoteSessions) { int stream = 0; synchronized (mRemoteStreams) { if (!mRemoteStreams.containsKey(token)) { Loading @@ -1217,8 +1230,10 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa } mCallbacks.onStateChanged(mState); } } public void setStreamVolume(int stream, int level) { if (mShowRemoteSessions) { final Token t = findToken(stream); if (t == null) { Log.w(TAG, "setStreamVolume: No token found for stream: " + stream); Loading @@ -1226,6 +1241,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa } mMediaSessions.setVolume(t, level); } } private Token findToken(int stream) { synchronized (mRemoteStreams) { Loading Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1894,6 +1894,9 @@ STREAM_MUSIC as if it's on TV platform. --> <bool name="config_single_volume">false</bool> <!-- Flag indicating whether the volume panel should show remote sessions. --> <bool name="config_volumeShowRemoteSessions">true</bool> <!-- Flag indicating that an outbound call must have a call capable phone account that has declared it can process the call's handle. --> <bool name="config_requireCallCapableAccountForHandle">false</bool> Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -4408,4 +4408,6 @@ <java-symbol type="integer" name="config_hotwordDetectedResultMaxBundleSize" /> <java-symbol type="dimen" name="config_wallpaperDimAmount" /> <java-symbol type="bool" name="config_volumeShowRemoteSessions" /> </resources>
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogControllerImpl.java +74 −58 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa private final MediaSessions mMediaSessions; protected C mCallbacks = new C(); private final State mState = new State(); protected final MediaSessionsCallbacks mMediaSessionsCallbacksW = new MediaSessionsCallbacks(); protected final MediaSessionsCallbacks mMediaSessionsCallbacksW; private final Optional<Vibrator> mVibrator; private final boolean mHasVibrator; private boolean mShowA11yStream; Loading Loading @@ -179,6 +179,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mWorkerLooper = theadFactory.buildLooperOnNewThread( VolumeDialogControllerImpl.class.getSimpleName()); mWorker = new W(mWorkerLooper); mMediaSessionsCallbacksW = new MediaSessionsCallbacks(mContext); mMediaSessions = createMediaSessions(mContext, mWorkerLooper, mMediaSessionsCallbacksW); mAudio = audioManager; mNoMan = notificationManager; Loading Loading @@ -1148,16 +1149,24 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa private final HashMap<Token, Integer> mRemoteStreams = new HashMap<>(); private int mNextStream = DYNAMIC_STREAM_START_INDEX; private final boolean mShowRemoteSessions; public MediaSessionsCallbacks(Context context) { mShowRemoteSessions = context.getResources().getBoolean( com.android.internal.R.bool.config_volumeShowRemoteSessions); } @Override public void onRemoteUpdate(Token token, String name, PlaybackInfo pi) { if (mShowRemoteSessions) { addStream(token, "onRemoteUpdate"); int stream = 0; synchronized (mRemoteStreams) { stream = mRemoteStreams.get(token); } Slog.d(TAG, "onRemoteUpdate: stream: " + stream + " volume: " + pi.getCurrentVolume()); Slog.d(TAG, "onRemoteUpdate: stream: " + stream + " volume: " + pi.getCurrentVolume()); boolean changed = mState.states.indexOfKey(stream) < 0; final StreamState ss = streamStateW(stream); ss.dynamic = true; Loading @@ -1177,9 +1186,11 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mCallbacks.onStateChanged(mState); } } } @Override public void onRemoteVolumeChanged(Token token, int flags) { if (mShowRemoteSessions) { addStream(token, "onRemoteVolumeChanged"); int stream = 0; synchronized (mRemoteStreams) { Loading @@ -1199,9 +1210,11 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa mCallbacks.onShowRequested(Events.SHOW_REASON_REMOTE_VOLUME_CHANGED); } } } @Override public void onRemoteRemoved(Token token) { if (mShowRemoteSessions) { int stream = 0; synchronized (mRemoteStreams) { if (!mRemoteStreams.containsKey(token)) { Loading @@ -1217,8 +1230,10 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa } mCallbacks.onStateChanged(mState); } } public void setStreamVolume(int stream, int level) { if (mShowRemoteSessions) { final Token t = findToken(stream); if (t == null) { Log.w(TAG, "setStreamVolume: No token found for stream: " + stream); Loading @@ -1226,6 +1241,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa } mMediaSessions.setVolume(t, level); } } private Token findToken(int stream) { synchronized (mRemoteStreams) { Loading