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

Commit 770d7ed7 authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by Automerger Merge Worker
Browse files

Merge "Enable sendText via bluetooth device." into sc-dev am: 61c0bd23

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/13750005

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie83beab571e494a6d7a6c2ba46e50ff5b323dbeb
parents 3215ae2e 61c0bd23
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@
package com.android.internal.telephony;

import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothMapClient;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.net.Uri;
@@ -40,10 +42,6 @@ public class BtSmsInterfaceManager {
     */
    public void sendText(Context context, String destAddr, String text, PendingIntent sentIntent,
            PendingIntent deliveryIntent, SubscriptionInfo info) {
        /*
        This is to remove the usage of hidden constant MAP_CLIENT and hidden API
        BluetoothMapClient.sendMessage(). This code is currently not functional anyway; it will be
        re-enabled in a later release.
        BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
        if (btAdapter == null) {
            // No bluetooth service on this platform?
@@ -56,10 +54,11 @@ public class BtSmsInterfaceManager {
            sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_INVALID_BLUETOOTH_ADDRESS);
            return;
        }
        btAdapter.getProfileProxy(context.getApplicationContext(),
        if (btAdapter.getProfileProxy(context.getApplicationContext(),
                new MapMessageSender(destAddr, text, device, sentIntent, deliveryIntent),
                BluetoothProfile.MAP_CLIENT);
        */
                BluetoothProfile.MAP_CLIENT)) {
            return;
        }
        throw new RuntimeException("Can't send message through BluetoothMapClient");
    }

@@ -100,7 +99,6 @@ public class BtSmsInterfaceManager {
        @Override
        public void onServiceConnected(int profile, BluetoothProfile proxy) {
            Log.d(LOG_TAG, "Service connected");
            /*
            if (profile != BluetoothProfile.MAP_CLIENT) {
                return;
            }
@@ -112,8 +110,6 @@ public class BtSmsInterfaceManager {
            }
            BluetoothAdapter.getDefaultAdapter()
                    .closeProfileProxy(BluetoothProfile.MAP_CLIENT, mapProfile);
            */
            throw new RuntimeException("Can't send message through BluetoothMapClient");
        }

        @Override