Loading src/com/android/server/telecom/TelecomServiceImpl.java +0 −6 Original line number Diff line number Diff line Loading @@ -530,12 +530,6 @@ public class TelecomServiceImpl { try { Log.startSession("TSI.rPA"); synchronized (mLock) { if (!((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { Log.w(this, "registerPhoneAccount not allowed on non-voice capable device."); return; } try { enforcePhoneAccountModificationForPackage( account.getAccountHandle().getComponentName().getPackageName()); Loading src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +2 −10 Original line number Diff line number Diff line Loading @@ -382,17 +382,9 @@ public class BluetoothDeviceManager { } public void disconnectAudio() { if (mBluetoothAdapter != null) { for (BluetoothDevice device: mBluetoothAdapter.getActiveDevices( BluetoothProfile.HEARING_AID)) { if (device != null) { mBluetoothAdapter.removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL); } } disconnectSco(); clearLeAudioCommunicationDevice(); } } public void disconnectSco() { if (mBluetoothHeadset == null) { Loading src/com/android/server/telecom/components/UserCallIntentProcessor.java +0 −15 Original line number Diff line number Diff line Loading @@ -80,11 +80,6 @@ public class UserCallIntentProcessor { */ public void processIntent(Intent intent, String callingPackageName, boolean canCallNonEmergency, boolean isLocalInvocation) { // Ensure call intents are not processed on devices that are not capable of calling. if (!isVoiceCapable()) { return; } String action = intent.getAction(); if (Intent.ACTION_CALL.equals(action) || Loading Loading @@ -159,16 +154,6 @@ public class UserCallIntentProcessor { sendIntentToDestination(intent, isLocalInvocation, callingPackageName); } /** * Returns whether the device is voice-capable (e.g. a phone vs a tablet). * * @return {@code True} if the device is voice-capable. */ private boolean isVoiceCapable() { return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable(); } /** * Potentially trampolines the intent to Telecom via TelecomServiceImpl. * If the caller is local to the Telecom service, we send the intent to Telecom without Loading tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase { .thenReturn(Arrays.asList(device2, null)); mBluetoothDeviceManager.disconnectAudio(); verify(mAdapter).removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL); verify(mBluetoothHeadset).disconnectAudio(); } Loading tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +0 −4 Original line number Diff line number Diff line Loading @@ -199,10 +199,6 @@ public class TelecomServiceImplTest extends TelecomTestCase { super.setUp(); mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); TelephonyManager mockTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); when(mockTelephonyManager.isVoiceCapable()).thenReturn(true); doReturn(mContext).when(mContext).getApplicationContext(); doReturn(mContext).when(mContext).createContextAsUser(any(UserHandle.class), anyInt()); doNothing().when(mContext).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), Loading Loading
src/com/android/server/telecom/TelecomServiceImpl.java +0 −6 Original line number Diff line number Diff line Loading @@ -530,12 +530,6 @@ public class TelecomServiceImpl { try { Log.startSession("TSI.rPA"); synchronized (mLock) { if (!((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable()) { Log.w(this, "registerPhoneAccount not allowed on non-voice capable device."); return; } try { enforcePhoneAccountModificationForPackage( account.getAccountHandle().getComponentName().getPackageName()); Loading
src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +2 −10 Original line number Diff line number Diff line Loading @@ -382,17 +382,9 @@ public class BluetoothDeviceManager { } public void disconnectAudio() { if (mBluetoothAdapter != null) { for (BluetoothDevice device: mBluetoothAdapter.getActiveDevices( BluetoothProfile.HEARING_AID)) { if (device != null) { mBluetoothAdapter.removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL); } } disconnectSco(); clearLeAudioCommunicationDevice(); } } public void disconnectSco() { if (mBluetoothHeadset == null) { Loading
src/com/android/server/telecom/components/UserCallIntentProcessor.java +0 −15 Original line number Diff line number Diff line Loading @@ -80,11 +80,6 @@ public class UserCallIntentProcessor { */ public void processIntent(Intent intent, String callingPackageName, boolean canCallNonEmergency, boolean isLocalInvocation) { // Ensure call intents are not processed on devices that are not capable of calling. if (!isVoiceCapable()) { return; } String action = intent.getAction(); if (Intent.ACTION_CALL.equals(action) || Loading Loading @@ -159,16 +154,6 @@ public class UserCallIntentProcessor { sendIntentToDestination(intent, isLocalInvocation, callingPackageName); } /** * Returns whether the device is voice-capable (e.g. a phone vs a tablet). * * @return {@code True} if the device is voice-capable. */ private boolean isVoiceCapable() { return ((TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE)) .isVoiceCapable(); } /** * Potentially trampolines the intent to Telecom via TelecomServiceImpl. * If the caller is local to the Telecom service, we send the intent to Telecom without Loading
tests/src/com/android/server/telecom/tests/BluetoothDeviceManagerTest.java +0 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,6 @@ public class BluetoothDeviceManagerTest extends TelecomTestCase { .thenReturn(Arrays.asList(device2, null)); mBluetoothDeviceManager.disconnectAudio(); verify(mAdapter).removeActiveDevice(BluetoothAdapter.ACTIVE_DEVICE_ALL); verify(mBluetoothHeadset).disconnectAudio(); } Loading
tests/src/com/android/server/telecom/tests/TelecomServiceImplTest.java +0 −4 Original line number Diff line number Diff line Loading @@ -199,10 +199,6 @@ public class TelecomServiceImplTest extends TelecomTestCase { super.setUp(); mContext = mComponentContextFixture.getTestDouble().getApplicationContext(); TelephonyManager mockTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); when(mockTelephonyManager.isVoiceCapable()).thenReturn(true); doReturn(mContext).when(mContext).getApplicationContext(); doReturn(mContext).when(mContext).createContextAsUser(any(UserHandle.class), anyInt()); doNothing().when(mContext).sendBroadcastAsUser(any(Intent.class), any(UserHandle.class), Loading