We need to send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED intent to all users
because bluetooth manager service use this intent to change name.
Bluetooth manager service is always running as User 0. but it is always binding
to bluetooth service running at foreground user, So the bluetooth service
need send BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED broadcast intent
to all users to let bluetooth manager service to receive it at any cases.
bug
7476965
Change-Id: I816786d0828d4a7d414077b1ccbe12d2e273fc75
intent = new Intent(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED);
intent.putExtra(BluetoothAdapter.EXTRA_LOCAL_NAME, mName);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
- mService.sendBroadcast(intent, mService.BLUETOOTH_PERM);
+ mService.sendBroadcastAsUser(intent, UserHandle.ALL,
+ mService.BLUETOOTH_PERM);
debugLog("Name is: " + mName);
break;
case AbstractionLayer.BT_PROPERTY_BDADDR: