diff options
author | Matthew Xie <mattx@google.com> | 2014-08-04 10:40:24 -0700 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2014-08-04 10:49:41 -0700 |
commit | 62fb56f2ba7d998e3e7416fc19d25ea91cc85111 (patch) | |
tree | fab9eb413d88102a242393408e1cfc2a55b18d35 /src/com/android/bluetooth/hdp/HealthService.java | |
parent | a08ff547783c43175c90ed8bd3e4db53482b3dde (diff) | |
download | android_packages_apps_Bluetooth-62fb56f2ba7d998e3e7416fc19d25ea91cc85111.tar.gz android_packages_apps_Bluetooth-62fb56f2ba7d998e3e7416fc19d25ea91cc85111.tar.bz2 android_packages_apps_Bluetooth-62fb56f2ba7d998e3e7416fc19d25ea91cc85111.zip |
Check null mHandler condition before invoking method on it
There is a path that clean up is called before stop call on HealthService
mHandler could be set to null
bug 16784750
Change-Id: Ie931fa502cf82d21c6bf97a8dc7035e5a1ed4b2e
Diffstat (limited to 'src/com/android/bluetooth/hdp/HealthService.java')
-rw-r--r-- | src/com/android/bluetooth/hdp/HealthService.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/hdp/HealthService.java b/src/com/android/bluetooth/hdp/HealthService.java index cef06e81b..21846c677 100644 --- a/src/com/android/bluetooth/hdp/HealthService.java +++ b/src/com/android/bluetooth/hdp/HealthService.java @@ -100,10 +100,12 @@ public class HealthService extends ProfileService { } protected boolean stop() { - mHandler.removeCallbacksAndMessages(null); - Looper looper = mHandler.getLooper(); - if (looper != null) { - looper.quit(); + if (mHandler != null) { + mHandler.removeCallbacksAndMessages(null); + Looper looper = mHandler.getLooper(); + if (looper != null) { + looper.quit(); + } } cleanupApps(); return true; |