diff options
author | erfanian <erfanian@google.com> | 2018-06-21 14:32:06 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-21 15:55:57 -0700 |
commit | cda290995783e09079df80a0ca5279887d5f37e1 (patch) | |
tree | e0310cba619c3267d615a51a42d9b146871d1733 | |
parent | c451dd563c5d7d15220c9d7a9c0ff42b2600e85b (diff) |
Use context only after it is available.
Bug: 88003605
Test: Not possible; robo does not support a widget and the test suite is disabled.
PiperOrigin-RevId: 201587545
Change-Id: I3683cb5649f9384c63e2156c67a38b3ff31675d7
-rw-r--r-- | java/com/android/dialer/searchfragment/list/NewSearchFragment.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java index 5417fcf8c..fd6db75e9 100644 --- a/java/com/android/dialer/searchfragment/list/NewSearchFragment.java +++ b/java/com/android/dialer/searchfragment/list/NewSearchFragment.java @@ -275,7 +275,8 @@ public final class NewSearchFragment extends Fragment return false; } - if (PermissionsUtil.hasLocationPermissions(getContext()) + if (getContext() == null + || PermissionsUtil.hasLocationPermissions(getContext()) || hasBeenDismissed() || !isRegularSearch()) { adapter.hideLocationPermissionRequest(); |