diff options
| author | 2015-08-28 15:40:51 +0000 | |
|---|---|---|
| committer | 2015-08-28 15:40:51 +0000 | |
| commit | 5af3d58ea2f18e8cc667359f5e80781c6a7004aa (patch) | |
| tree | c16a155b8be151bd952bc6e643ce9c01a569240a | |
| parent | b804f4134a21989c94ead728b6d36f93a647ce36 (diff) | |
| parent | a3d10f015f01d65091a15bfd698b45246a9819c6 (diff) | |
am a3d10f01: am c02034a1: am 34c08828: Merge "Fix NPE in AR hardware binding sequence. b/22772433" into mnc-dr-dev
* commit 'a3d10f015f01d65091a15bfd698b45246a9819c6':
Fix NPE in AR hardware binding sequence. b/22772433
| -rw-r--r-- | services/core/java/com/android/server/location/ActivityRecognitionProxy.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/location/ActivityRecognitionProxy.java b/services/core/java/com/android/server/location/ActivityRecognitionProxy.java index 2eb58bfd2638..55222dc305c3 100644 --- a/services/core/java/com/android/server/location/ActivityRecognitionProxy.java +++ b/services/core/java/com/android/server/location/ActivityRecognitionProxy.java @@ -123,6 +123,12 @@ public class ActivityRecognitionProxy { Log.e(TAG, "No watcher found on connection."); return; } + if (mInstance == null) { + // to keep backwards compatibility do not update the watcher when there is no + // instance available, or it will cause an NPE + Log.d(TAG, "AR HW instance not available, binding will be a no-op."); + return; + } try { watcher.onInstanceChanged(mInstance); } catch (RemoteException e) { |