Loading media/java/android/media/AudioService.java +29 −7 Original line number Diff line number Diff line Loading @@ -506,6 +506,15 @@ public class AudioService extends IAudioService.Stub { } index = streamState.mIndex; } if (streamType == AudioSystem.STREAM_RING) { synchronized(mRingingLock) { if (mIsRinging) { updateRingingAudioFocus(); } } } // UI showVolumeChangeUi(streamType, flags); // Broadcast Intent Loading @@ -524,6 +533,14 @@ public class AudioService extends IAudioService.Stub { index = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex; if (streamType == AudioSystem.STREAM_RING) { synchronized(mRingingLock) { if (mIsRinging) { updateRingingAudioFocus(); } } } // UI, etc. showVolumeChangeUi(streamType, flags); // Broadcast Intent Loading Loading @@ -2155,13 +2172,7 @@ public class AudioService extends IAudioService.Stub { synchronized(mRingingLock) { mIsRinging = true; } int ringVolume = AudioService.this.getStreamVolume(AudioManager.STREAM_RING); if (ringVolume > 0) { requestAudioFocus(AudioManager.STREAM_RING, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT, null, null /* both allowed to be null only for this clientId */, IN_VOICE_COMM_FOCUS_ID /*clientId*/); } updateRingingAudioFocus(); } else if (state == TelephonyManager.CALL_STATE_OFFHOOK) { //Log.v(TAG, " CALL_STATE_OFFHOOK"); synchronized(mRingingLock) { Loading @@ -2181,6 +2192,17 @@ public class AudioService extends IAudioService.Stub { } }; private void updateRingingAudioFocus() { int ringVolume = getStreamVolume(AudioManager.STREAM_RING); int hint = ringVolume > 0 ? AudioManager.AUDIOFOCUS_GAIN_TRANSIENT : AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK; requestAudioFocus(AudioManager.STREAM_RING, hint, null, null /* both allowed to be null only for this clientId */, IN_VOICE_COMM_FOCUS_ID /*clientId*/); } private void notifyTopOfAudioFocusStack() { // notify the top of the stack it gained focus if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) { Loading Loading
media/java/android/media/AudioService.java +29 −7 Original line number Diff line number Diff line Loading @@ -506,6 +506,15 @@ public class AudioService extends IAudioService.Stub { } index = streamState.mIndex; } if (streamType == AudioSystem.STREAM_RING) { synchronized(mRingingLock) { if (mIsRinging) { updateRingingAudioFocus(); } } } // UI showVolumeChangeUi(streamType, flags); // Broadcast Intent Loading @@ -524,6 +533,14 @@ public class AudioService extends IAudioService.Stub { index = (streamState.muteCount() != 0) ? streamState.mLastAudibleIndex : streamState.mIndex; if (streamType == AudioSystem.STREAM_RING) { synchronized(mRingingLock) { if (mIsRinging) { updateRingingAudioFocus(); } } } // UI, etc. showVolumeChangeUi(streamType, flags); // Broadcast Intent Loading Loading @@ -2155,13 +2172,7 @@ public class AudioService extends IAudioService.Stub { synchronized(mRingingLock) { mIsRinging = true; } int ringVolume = AudioService.this.getStreamVolume(AudioManager.STREAM_RING); if (ringVolume > 0) { requestAudioFocus(AudioManager.STREAM_RING, AudioManager.AUDIOFOCUS_GAIN_TRANSIENT, null, null /* both allowed to be null only for this clientId */, IN_VOICE_COMM_FOCUS_ID /*clientId*/); } updateRingingAudioFocus(); } else if (state == TelephonyManager.CALL_STATE_OFFHOOK) { //Log.v(TAG, " CALL_STATE_OFFHOOK"); synchronized(mRingingLock) { Loading @@ -2181,6 +2192,17 @@ public class AudioService extends IAudioService.Stub { } }; private void updateRingingAudioFocus() { int ringVolume = getStreamVolume(AudioManager.STREAM_RING); int hint = ringVolume > 0 ? AudioManager.AUDIOFOCUS_GAIN_TRANSIENT : AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK; requestAudioFocus(AudioManager.STREAM_RING, hint, null, null /* both allowed to be null only for this clientId */, IN_VOICE_COMM_FOCUS_ID /*clientId*/); } private void notifyTopOfAudioFocusStack() { // notify the top of the stack it gained focus if (!mFocusStack.empty() && (mFocusStack.peek().mFocusDispatcher != null)) { Loading