Loading src/com/android/server/telecom/CallAudioRoutePeripheralAdapter.java +10 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,16 @@ public class CallAudioRoutePeripheralAdapter implements WiredHeadsetManager.List return mBluetoothRouteManager.isBluetoothAudioConnectedOrPending(); } public boolean isHearingAidDeviceOn() { return mBluetoothRouteManager.isCachedHearingAidDevice( mBluetoothRouteManager.getBluetoothAudioConnectedDevice()); } public boolean isLeAudioDeviceOn() { return mBluetoothRouteManager.isCachedLeAudioDevice( mBluetoothRouteManager.getBluetoothAudioConnectedDevice()); } @Override public void onBluetoothDeviceListChanged() { mCallAudioRouteStateMachine.sendMessageWithSessionInfo( Loading src/com/android/server/telecom/CallsManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -5596,4 +5596,16 @@ public class CallsManager extends Call.ListenerBase UserHandle userHandle, ConnectionServiceWrapper service) { mConnectionServiceRepository.setService(componentName, userHandle, service); } /** * Generates a log "marking". This is a unique call event which contains a specified message. * A log mark is triggered by the command: adb shell telecom log-mark MESSAGE * A tester can use this when executing tests to make it very clear when a particular test step * was reached. * @param message the message to mark in the logs. */ public void requestLogMark(String message) { mCalls.forEach(c -> Log.addEvent(c, LogUtils.Events.USER_LOG_MARK, message)); Log.addEvent(null /* global */, LogUtils.Events.USER_LOG_MARK, message); } } src/com/android/server/telecom/InCallTonePlayer.java +16 −3 Original line number Diff line number Diff line Loading @@ -182,6 +182,9 @@ public class InCallTonePlayer extends Thread { private static final int STATE_ON = 1; private static final int STATE_STOPPED = 2; // Invalid audio stream private static final int STREAM_INVALID = -1; /** * Keeps count of the number of actively playing tones so that we can notify CallAudioManager * when we need focus and when it can be release. This should only be manipulated from the main Loading Loading @@ -260,6 +263,7 @@ public class InCallTonePlayer extends Thread { final int mediaResourceId; // The resourceId of the tone to play. Used for media-based // tones. int stream = STREAM_INVALID; switch (mToneId) { case TONE_BUSY: // TODO: CDMA-specific tones Loading Loading @@ -327,6 +331,12 @@ public class InCallTonePlayer extends Thread { toneVolume = RELATIVE_VOLUME_HIPRI; toneLengthMillis = Integer.MAX_VALUE - TIMEOUT_BUFFER_MILLIS; mediaResourceId = TONE_RESOURCE_ID_UNDEFINED; // When a hearing aid device or a LE audio device is used, ring back tone should // use STREAM_VOICE_CALL if (mCallAudioRoutePeripheralAdapter.isLeAudioDeviceOn() || mCallAudioRoutePeripheralAdapter.isHearingAidDeviceOn()) { stream = AudioManager.STREAM_VOICE_CALL; } break; case TONE_UNOBTAINABLE_NUMBER: toneType = ToneGenerator.TONE_SUP_ERROR; Loading Loading @@ -358,10 +368,13 @@ public class InCallTonePlayer extends Thread { throw new IllegalStateException("Bad toneId: " + mToneId); } int stream = AudioManager.STREAM_VOICE_CALL; // Don't override already valid stream values if (stream == STREAM_INVALID) { stream = AudioManager.STREAM_VOICE_CALL; if (mCallAudioRoutePeripheralAdapter.isBluetoothAudioOn()) { stream = AudioManager.STREAM_BLUETOOTH_SCO; } } if (toneType != ToneGenerator.TONE_UNKNOWN) { playToneGeneratorTone(stream, toneVolume, toneType, toneLengthMillis); Loading src/com/android/server/telecom/TelecomServiceImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -2025,6 +2025,24 @@ public class TelecomServiceImpl { } } @Override public void requestLogMark(String message) { try { Log.startSession("TSI.rLM"); enforceShellOnly(Binder.getCallingUid(), "requestLogMark is for shell only"); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { mCallsManager.requestLogMark(message); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } @Override public void setTestPhoneAcctSuggestionComponent(String flattenedComponentName) { try { Loading src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -644,6 +644,14 @@ public class BluetoothRouteManager extends StateMachine { mHfpActiveDeviceCache != null; } public boolean isCachedLeAudioDevice(BluetoothDevice device) { return mLeAudioActiveDeviceCache != null && mLeAudioActiveDeviceCache.equals(device); } public boolean isCachedHearingAidDevice(BluetoothDevice device) { return mHearingAidActiveDeviceCache != null && mHearingAidActiveDeviceCache.equals(device); } public Collection<BluetoothDevice> getConnectedDevices() { return mDeviceManager.getUniqueConnectedDevices(); } Loading Loading
src/com/android/server/telecom/CallAudioRoutePeripheralAdapter.java +10 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,16 @@ public class CallAudioRoutePeripheralAdapter implements WiredHeadsetManager.List return mBluetoothRouteManager.isBluetoothAudioConnectedOrPending(); } public boolean isHearingAidDeviceOn() { return mBluetoothRouteManager.isCachedHearingAidDevice( mBluetoothRouteManager.getBluetoothAudioConnectedDevice()); } public boolean isLeAudioDeviceOn() { return mBluetoothRouteManager.isCachedLeAudioDevice( mBluetoothRouteManager.getBluetoothAudioConnectedDevice()); } @Override public void onBluetoothDeviceListChanged() { mCallAudioRouteStateMachine.sendMessageWithSessionInfo( Loading
src/com/android/server/telecom/CallsManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -5596,4 +5596,16 @@ public class CallsManager extends Call.ListenerBase UserHandle userHandle, ConnectionServiceWrapper service) { mConnectionServiceRepository.setService(componentName, userHandle, service); } /** * Generates a log "marking". This is a unique call event which contains a specified message. * A log mark is triggered by the command: adb shell telecom log-mark MESSAGE * A tester can use this when executing tests to make it very clear when a particular test step * was reached. * @param message the message to mark in the logs. */ public void requestLogMark(String message) { mCalls.forEach(c -> Log.addEvent(c, LogUtils.Events.USER_LOG_MARK, message)); Log.addEvent(null /* global */, LogUtils.Events.USER_LOG_MARK, message); } }
src/com/android/server/telecom/InCallTonePlayer.java +16 −3 Original line number Diff line number Diff line Loading @@ -182,6 +182,9 @@ public class InCallTonePlayer extends Thread { private static final int STATE_ON = 1; private static final int STATE_STOPPED = 2; // Invalid audio stream private static final int STREAM_INVALID = -1; /** * Keeps count of the number of actively playing tones so that we can notify CallAudioManager * when we need focus and when it can be release. This should only be manipulated from the main Loading Loading @@ -260,6 +263,7 @@ public class InCallTonePlayer extends Thread { final int mediaResourceId; // The resourceId of the tone to play. Used for media-based // tones. int stream = STREAM_INVALID; switch (mToneId) { case TONE_BUSY: // TODO: CDMA-specific tones Loading Loading @@ -327,6 +331,12 @@ public class InCallTonePlayer extends Thread { toneVolume = RELATIVE_VOLUME_HIPRI; toneLengthMillis = Integer.MAX_VALUE - TIMEOUT_BUFFER_MILLIS; mediaResourceId = TONE_RESOURCE_ID_UNDEFINED; // When a hearing aid device or a LE audio device is used, ring back tone should // use STREAM_VOICE_CALL if (mCallAudioRoutePeripheralAdapter.isLeAudioDeviceOn() || mCallAudioRoutePeripheralAdapter.isHearingAidDeviceOn()) { stream = AudioManager.STREAM_VOICE_CALL; } break; case TONE_UNOBTAINABLE_NUMBER: toneType = ToneGenerator.TONE_SUP_ERROR; Loading Loading @@ -358,10 +368,13 @@ public class InCallTonePlayer extends Thread { throw new IllegalStateException("Bad toneId: " + mToneId); } int stream = AudioManager.STREAM_VOICE_CALL; // Don't override already valid stream values if (stream == STREAM_INVALID) { stream = AudioManager.STREAM_VOICE_CALL; if (mCallAudioRoutePeripheralAdapter.isBluetoothAudioOn()) { stream = AudioManager.STREAM_BLUETOOTH_SCO; } } if (toneType != ToneGenerator.TONE_UNKNOWN) { playToneGeneratorTone(stream, toneVolume, toneType, toneLengthMillis); Loading
src/com/android/server/telecom/TelecomServiceImpl.java +18 −0 Original line number Diff line number Diff line Loading @@ -2025,6 +2025,24 @@ public class TelecomServiceImpl { } } @Override public void requestLogMark(String message) { try { Log.startSession("TSI.rLM"); enforceShellOnly(Binder.getCallingUid(), "requestLogMark is for shell only"); synchronized (mLock) { long token = Binder.clearCallingIdentity(); try { mCallsManager.requestLogMark(message); } finally { Binder.restoreCallingIdentity(token); } } } finally { Log.endSession(); } } @Override public void setTestPhoneAcctSuggestionComponent(String flattenedComponentName) { try { Loading
src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -644,6 +644,14 @@ public class BluetoothRouteManager extends StateMachine { mHfpActiveDeviceCache != null; } public boolean isCachedLeAudioDevice(BluetoothDevice device) { return mLeAudioActiveDeviceCache != null && mLeAudioActiveDeviceCache.equals(device); } public boolean isCachedHearingAidDevice(BluetoothDevice device) { return mHearingAidActiveDeviceCache != null && mHearingAidActiveDeviceCache.equals(device); } public Collection<BluetoothDevice> getConnectedDevices() { return mDeviceManager.getUniqueConnectedDevices(); } Loading