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

Commit 3e295686 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "GetName/SetName: Broadcast intent from server" into main

parents 3f8be643 585fecf2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -977,6 +977,7 @@ class AdapterProperties {
                        mName = name;
                        if (Flags.getNameAndAddressAsCallback()) {
                            mService.updateAdapterName(mName);
                            break;
                        }
                        intent = new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED);
                        intent.putExtra(BluetoothAdapter.EXTRA_LOCAL_NAME, mName);
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.bluetooth;

import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.bluetooth.BluetoothAdapter.STATE_BLE_ON;
import static android.bluetooth.BluetoothAdapter.STATE_BLE_TURNING_OFF;
import static android.bluetooth.BluetoothAdapter.STATE_BLE_TURNING_ON;
@@ -254,6 +255,13 @@ class BluetoothManagerService {
        }
        mName = name;
        Log.v(TAG, "storeName(" + mName + "): Success");
        mContext.sendBroadcastAsUser(
                new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED)
                        .putExtra(BluetoothAdapter.EXTRA_LOCAL_NAME, name)
                        .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT),
                UserHandle.ALL,
                BLUETOOTH_CONNECT,
                getTempAllowlistBroadcastOptions());
    }

    private void storeAddress(String address) {