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

Commit f51faaeb authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Comment out code to send SMS over BT.

This is to remove the usage of hidden constant MAP_CLIENT. This code
is not functional so it is ok to comment it out for now.

Test: basic sanity
Bug: 137202333
Change-Id: I3583f5a76ed13627f624fb20ecd3aab8cfceb615
parent b98e8421
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
package com.android.internal.telephony;

import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
@@ -41,6 +40,10 @@ 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,6 +59,8 @@ public class BtSmsInterfaceManager {
        btAdapter.getProfileProxy(context.getApplicationContext(),
                new MapMessageSender(destAddr, text, device, sentIntent, deliveryIntent),
                BluetoothProfile.MAP_CLIENT);
        */
        throw new RuntimeException("Can't send message through BluetoothMapClient");
    }

    private void sendErrorInPendingIntent(PendingIntent intent, int errorCode) {
@@ -95,23 +100,21 @@ public class BtSmsInterfaceManager {
        @Override
        public void onServiceConnected(int profile, BluetoothProfile proxy) {
            Log.d(LOG_TAG, "Service connected");
            /*
            if (profile != BluetoothProfile.MAP_CLIENT) {
                return;
            }
            // Comment out the method for mainline (b/143848423). The profile is not for a phone,
            // so it will not be enabled.
/*            BluetoothMapClient mapProfile = (BluetoothMapClient) proxy;
            BluetoothMapClient mapProfile = (BluetoothMapClient) proxy;
            if (mMessage != null) {
                Log.d(LOG_TAG, "Sending message thru bluetooth");
                mapProfile.sendMessage(mDevice, mDestAddr, mMessage, mSentIntent, mDeliveryIntent);
                mMessage = null;
            }
            BluetoothAdapter.getDefaultAdapter()
                    .closeProfileProxy(BluetoothProfile.MAP_CLIENT, mapProfile);*/
            if (mMessage != null) {
                    .closeProfileProxy(BluetoothProfile.MAP_CLIENT, mapProfile);
            */
            throw new RuntimeException("Can't send message through BluetoothMapClient");
        }
        }

        @Override
        public void onServiceDisconnected(int profile) {