diff options
author | Eric Laurent <elaurent@google.com> | 2011-09-02 14:20:56 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2011-09-02 15:59:50 -0700 |
commit | dca56b9432e2cc851d1a58920071fed2e1e3d142 (patch) | |
tree | dec365b40e97c1e8331db5e0174548251aebdb92 /core/java/android/bluetooth | |
parent | 5afd2bd02ae44d5a38f9e560047723ddab176405 (diff) | |
download | frameworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.zip frameworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.tar.gz frameworks_base-dca56b9432e2cc851d1a58920071fed2e1e3d142.tar.bz2 |
Fix issue 5252593: any app can restart the runtime
Replace null device address string by empty sting.
Change-Id: I285c35f3345334e6d2190493b1a8a5aca1a361a4
Diffstat (limited to 'core/java/android/bluetooth')
-rw-r--r-- | core/java/android/bluetooth/BluetoothDeviceProfileState.java | 2 | ||||
-rw-r--r-- | core/java/android/bluetooth/BluetoothProfileState.java | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java index 316c474..48d0203 100644 --- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java +++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java @@ -127,7 +127,7 @@ public final class BluetoothDeviceProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); - if (!device.equals(mDevice)) return; + if (device == null || !device.equals(mDevice)) return; if (action.equals(BluetoothA2dp.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); diff --git a/core/java/android/bluetooth/BluetoothProfileState.java b/core/java/android/bluetooth/BluetoothProfileState.java index 98afdb8..b0c0a0b 100644 --- a/core/java/android/bluetooth/BluetoothProfileState.java +++ b/core/java/android/bluetooth/BluetoothProfileState.java @@ -59,7 +59,9 @@ public class BluetoothProfileState extends StateMachine { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); - + if (device == null) { + return; + } if (action.equals(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED)) { int newState = intent.getIntExtra(BluetoothProfile.EXTRA_STATE, 0); if (mProfile == HFP && (newState == BluetoothProfile.STATE_CONNECTED || |