BluetoothPairingRequest: Add null check for action

Bug: 159728132
Test: Build

Change-Id: I24668e20accf96c7469c9e1ab589b1383ab59d18
This commit is contained in:
Chen Chen
2020-07-23 16:27:50 -07:00
parent bea26691e2
commit 1805f666e7

View File

@@ -34,7 +34,7 @@ public final class BluetoothPairingRequest extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (!action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
if (action == null || !action.equals(BluetoothDevice.ACTION_PAIRING_REQUEST)) {
return;
}
// convert broadcast intent into activity intent (same action string)