From fc7b6693eea970153468ee1a436d6538a780cac4 Mon Sep 17 00:00:00 2001 From: Chen Chen Date: Thu, 23 Jul 2020 16:27:50 -0700 Subject: [PATCH] BluetoothPairingRequest: Add null check for action Bug: 159728132 Test: Build Change-Id: I24668e20accf96c7469c9e1ab589b1383ab59d18 Merged-In: I24668e20accf96c7469c9e1ab589b1383ab59d18 (cherry picked from commit 1805f666e7a88ce879dd3c281cbb8d0696c3e174) --- src/com/android/settings/bluetooth/BluetoothPairingRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java index 7da63428c72..3cd21f5d6de 100644 --- a/src/com/android/settings/bluetooth/BluetoothPairingRequest.java +++ b/src/com/android/settings/bluetooth/BluetoothPairingRequest.java @@ -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)