Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12ba1d42 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8422005 from 5dfd01c7 to tm-release

Change-Id: I81d4c9f4f34c4afeb6e65bef1663ce9086370b6a
parents 97f72ec9 5dfd01c7
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -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());
+2 −10
Original line number Diff line number Diff line
@@ -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) {
+0 −15
Original line number Diff line number Diff line
@@ -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) ||
@@ -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
+0 −1
Original line number Diff line number Diff line
@@ -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();
    }

+0 −4
Original line number Diff line number Diff line
@@ -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