@@ -401,6 +401,7 @@ private void onDevicePropertyChanged(String deviceObjectPath, String[] propValue
401401 Intent intent = new Intent (BluetoothDevice .ACTION_NAME_CHANGED );
402402 intent .putExtra (BluetoothDevice .EXTRA_DEVICE , device );
403403 intent .putExtra (BluetoothDevice .EXTRA_NAME , propValues [1 ]);
404+ intent .addFlags (Intent .FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT );
404405 mContext .sendBroadcast (intent , BLUETOOTH_PERM );
405406 } else if (name .equals ("Alias" )) {
406407 mBluetoothService .setRemoteDeviceProperty (address , name , propValues [1 ]);
@@ -410,6 +411,7 @@ private void onDevicePropertyChanged(String deviceObjectPath, String[] propValue
410411 intent .putExtra (BluetoothDevice .EXTRA_DEVICE , device );
411412 intent .putExtra (BluetoothDevice .EXTRA_CLASS ,
412413 new BluetoothClass (Integer .valueOf (propValues [1 ])));
414+ intent .addFlags (Intent .FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT );
413415 mContext .sendBroadcast (intent , BLUETOOTH_PERM );
414416 } else if (name .equals ("Connected" )) {
415417 mBluetoothService .setRemoteDeviceProperty (address , name , propValues [1 ]);
@@ -425,6 +427,7 @@ private void onDevicePropertyChanged(String deviceObjectPath, String[] propValue
425427 intent = new Intent (BluetoothDevice .ACTION_ACL_DISCONNECTED );
426428 }
427429 intent .putExtra (BluetoothDevice .EXTRA_DEVICE , device );
430+ intent .addFlags (Intent .FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT );
428431 mContext .sendBroadcast (intent , BLUETOOTH_PERM );
429432 } else if (name .equals ("UUIDs" )) {
430433 String uuid = null ;
0 commit comments