diff options
author | Matthew Xie <mattx@google.com> | 2014-12-03 16:52:37 -0800 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2014-12-03 16:52:37 -0800 |
commit | abe1879f779481f9ee1a48b2de343097a6ddcf85 (patch) | |
tree | 79bc5e5e1b2ac271afca94e68a4749f2f244859c /src/com/android/bluetooth | |
parent | cf496e4230a5067a19e067115502b3961c9bf220 (diff) | |
download | android_packages_apps_Bluetooth-abe1879f779481f9ee1a48b2de343097a6ddcf85.tar.gz android_packages_apps_Bluetooth-abe1879f779481f9ee1a48b2de343097a6ddcf85.tar.bz2 android_packages_apps_Bluetooth-abe1879f779481f9ee1a48b2de343097a6ddcf85.zip |
Nullpointer check on mAdapterService in ProfileService#onCreate
Bug: 18595130
Change-Id: I02d588dab94e1dc6c24402259e5b8cea2a98b482
Diffstat (limited to 'src/com/android/bluetooth')
-rw-r--r-- | src/com/android/bluetooth/btservice/ProfileService.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/bluetooth/btservice/ProfileService.java b/src/com/android/bluetooth/btservice/ProfileService.java index 1dcb7fb25..d02924982 100644 --- a/src/com/android/bluetooth/btservice/ProfileService.java +++ b/src/com/android/bluetooth/btservice/ProfileService.java @@ -32,6 +32,8 @@ import android.util.Log; public abstract class ProfileService extends Service { private static final boolean DBG = false; + private static final String TAG = "BluetoothProfileService"; + //For Debugging only private static HashMap<String, Integer> sReferenceCount = new HashMap<String,Integer>(); @@ -108,7 +110,11 @@ public abstract class ProfileService extends Service { mAdapter = BluetoothAdapter.getDefaultAdapter(); mBinder = initBinder(); mAdapterService = AdapterService.getAdapterService(); - mAdapterService.addProfile(this); + if (mAdapterService != null) { + mAdapterService.addProfile(this); + } else { + Log.w(TAG, "onCreate, null mAdapterService"); + } } public int onStartCommand(Intent intent, int flags, int startId) { |