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

Commit c4c90832 authored by Hui Yu's avatar Hui Yu
Browse files

Temp allowlist bluetooth broadcast to start FGS.

Bug: 182816627
Test: atest com.android.bluetooth.map.BluetoothMapServiceTest
Test: atest com.android.bluetooth.pan.PanServiceTest
Test: atest com.android.bluetooth.sap.SapServiceTest
Change-Id: I1a415210be95a0cf6e1476060a19660a99628b8c
parent 2b288b84
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -375,7 +375,8 @@ public class BluetoothMapService extends ProfileService {
                        intent.putExtra(BluetoothDevice.EXTRA_DEVICE, sRemoteDevice);
                        intent.putExtra(BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE,
                                BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS);
                        sendBroadcast(intent, BLUETOOTH_CONNECT);
                        sendBroadcast(intent, BLUETOOTH_CONNECT,
                                Utils.getTempAllowlistBroadcastOptions());
                        cancelUserTimeoutAlarm();
                        mIsWaitingAuthorization = false;
                        stopObexServerSessions(-1);
+3 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import android.text.format.Formatter;
import android.util.Log;

import com.android.bluetooth.R;
import com.android.bluetooth.Utils;

import java.util.HashMap;

@@ -349,7 +350,8 @@ class BluetoothOppNotification {
                intent.putExtra(Constants.EXTRA_BT_OPP_TRANSFER_ID, item.id);
                intent.putExtra(Constants.EXTRA_BT_OPP_TRANSFER_PROGRESS, progress);
                intent.putExtra(Constants.EXTRA_BT_OPP_ADDRESS, item.destination);
                mContext.sendBroadcast(intent, Constants.HANDOVER_STATUS_PERMISSION);
                mContext.sendBroadcast(intent, Constants.HANDOVER_STATUS_PERMISSION,
                        Utils.getTempAllowlistBroadcastOptions());
                continue;
            }
            // Build the notification object
+3 −1
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.webkit.MimeTypeMap;

import com.android.bluetooth.BluetoothMetricsProto;
import com.android.bluetooth.BluetoothObexTransport;
import com.android.bluetooth.Utils;
import com.android.bluetooth.btservice.MetricsLogger;

import java.io.FileNotFoundException;
@@ -605,7 +606,8 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler
                        Constants.COUNT_HEADER_UNAVAILABLE);
            }
            intent.putExtra(Constants.EXTRA_BT_OPP_ADDRESS, destination);
            mContext.sendBroadcast(intent, Constants.HANDOVER_STATUS_PERMISSION);
            mContext.sendBroadcast(intent, Constants.HANDOVER_STATUS_PERMISSION,
                    Utils.getTempAllowlistBroadcastOptions());
        }
        mTimestamp = System.currentTimeMillis();
        mNumFilesAttemptedToReceive = 0;
+3 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ import android.util.Log;
import android.widget.Toast;

import com.android.bluetooth.R;
import com.android.bluetooth.Utils;

/**
 * Receives and handles: system broadcasts; Intents from other applications;
@@ -248,7 +249,8 @@ public class BluetoothOppReceiver extends BroadcastReceiver {
                    handoverIntent.putExtra(Constants.EXTRA_BT_OPP_TRANSFER_STATUS,
                            Constants.HANDOVER_TRANSFER_STATUS_FAILURE);
                }
                context.sendBroadcast(handoverIntent, Constants.HANDOVER_STATUS_PERMISSION);
                context.sendBroadcast(handoverIntent, Constants.HANDOVER_STATUS_PERMISSION,
                        Utils.getTempAllowlistBroadcastOptions());
                return;
            }

+1 −1
Original line number Diff line number Diff line
@@ -399,7 +399,7 @@ public class PanService extends ProfileService {
            Intent intent = new Intent(BluetoothPan.ACTION_TETHERING_STATE_CHANGED);
            intent.putExtra(BluetoothPan.EXTRA_TETHERING_STATE,
                    mTetherOn ? BluetoothPan.TETHERING_STATE_ON : BluetoothPan.TETHERING_STATE_OFF);
            sendBroadcast(intent, BLUETOOTH_CONNECT);
            sendBroadcast(intent, BLUETOOTH_CONNECT, Utils.getTempAllowlistBroadcastOptions());
        }
    }

Loading