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

Commit 6b6189a9 authored by Andrew Cheng's avatar Andrew Cheng
Browse files

Use @SystemAPI version of BluetoothMapClient#sendMessage

Use the Collection<Uri> version of BluetoothMapClient#sendMessage
instead of the Uri[] version. The former is @SystemAPI, the latter is
@hide.

Bug: 206830632
Test: send text message with default messaging app.
Change-Id: I6164886165c4075b85c50e4a0ec493bb97115b39
parent 4929ca1b
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -29,6 +29,9 @@ import android.telephony.SmsManager;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionInfo;
import android.util.Log;
import android.util.Log;


import java.util.Collection;
import java.util.Collections;



/**
/**
 * BtSmsInterfaceManager to provide a mechanism for sending SMS over Bluetooth
 * BtSmsInterfaceManager to provide a mechanism for sending SMS over Bluetooth
@@ -77,7 +80,7 @@ public class BtSmsInterfaceManager {


    private class MapMessageSender implements BluetoothProfile.ServiceListener {
    private class MapMessageSender implements BluetoothProfile.ServiceListener {


        final Uri[] mDestAddr;
        final Collection<Uri> mDestAddr;
        private String mMessage;
        private String mMessage;
        final BluetoothDevice mDevice;
        final BluetoothDevice mDevice;
        final PendingIntent mSentIntent;
        final PendingIntent mSentIntent;
@@ -86,10 +89,10 @@ public class BtSmsInterfaceManager {
        MapMessageSender(final String destAddr, final String message, final BluetoothDevice device,
        MapMessageSender(final String destAddr, final String message, final BluetoothDevice device,
                final PendingIntent sentIntent, final PendingIntent deliveryIntent) {
                final PendingIntent sentIntent, final PendingIntent deliveryIntent) {
            super();
            super();
            mDestAddr = new Uri[]{new Uri.Builder()
            mDestAddr = Collections.singleton(new Uri.Builder()
                    .appendPath(destAddr)
                    .appendPath(destAddr)
                    .scheme(PhoneAccount.SCHEME_TEL)
                    .scheme(PhoneAccount.SCHEME_TEL)
                    .build()};
                    .build());
            mMessage = message;
            mMessage = message;
            mDevice = device;
            mDevice = device;
            mSentIntent = sentIntent;
            mSentIntent = sentIntent;