diff options
author | Etan Cohen <etancohen@google.com> | 2017-04-23 21:40:55 -0700 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2017-04-23 21:50:49 -0700 |
commit | b44557082dfab11dcd4b4344dfa6de7259058297 (patch) | |
tree | 78aa893ca5bf5a5c33a88acf2f3e01f274ba829a | |
parent | 2f602bbee8993732300e45007a1948b53ecf3f2e (diff) |
[AWARE] Fix crash of system service due to race condition with Aware
Aware service registers for callback with HalDeviceManager before it is
fully initialized.
This CL fixes the crash but not the underlying bug - will be fixed in a
subsequent CL.
Bug: 37613363
Test: builds
Change-Id: Ic6d77157a2287abcb7a31cf2aa4a98e253792bd6
-rw-r--r-- | service/java/com/android/server/wifi/aware/WifiAwareStateManager.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareStateManager.java b/service/java/com/android/server/wifi/aware/WifiAwareStateManager.java index a35c786ee..1d00d162d 100644 --- a/service/java/com/android/server/wifi/aware/WifiAwareStateManager.java +++ b/service/java/com/android/server/wifi/aware/WifiAwareStateManager.java @@ -391,6 +391,10 @@ public class WifiAwareStateManager { * only happens when a connection is created. */ public void enableUsage() { + if (mSm == null) { + Log.e(TAG, "enableUsage: race condition - called while mSm null!"); + return; + } Message msg = mSm.obtainMessage(MESSAGE_TYPE_COMMAND); msg.arg1 = COMMAND_TYPE_ENABLE_USAGE; mSm.sendMessage(msg); |