summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2015-12-15 12:05:55 -0800
committerandroid-build-merger <android-build-merger@google.com>2015-12-15 12:05:55 -0800
commit3304b448ec7f4188dc07ccd764a1977a1f1eae0a (patch)
tree5e96353dd9aac7159699df6fc78b98e62fa9d335
parentca3e23c6caeeb49f3fdc9556425ce211892ad00c (diff)
parentb3e1537ec563cf343f46c643a84d67078c44dabf (diff)
Fix NPE in startLoading
am: b3e1537ec5 * commit 'b3e1537ec563cf343f46c643a84d67078c44dabf': Fix NPE in startLoading
-rw-r--r--src/com/android/dialer/list/SearchFragment.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/dialer/list/SearchFragment.java b/src/com/android/dialer/list/SearchFragment.java
index 9b0f53621..980858f75 100644
--- a/src/com/android/dialer/list/SearchFragment.java
+++ b/src/com/android/dialer/list/SearchFragment.java
@@ -15,8 +15,6 @@
*/
package com.android.dialer.list;
-import static android.Manifest.permission.READ_CONTACTS;
-
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorListenerAdapter;
@@ -358,7 +356,11 @@ public class SearchFragment extends PhoneNumberPickerFragment {
@Override
protected void startLoading() {
- if (PermissionsUtil.hasPermission(getActivity(), READ_CONTACTS)) {
+ if (getActivity() == null) {
+ return;
+ }
+
+ if (PermissionsUtil.hasContactsPermissions(getActivity())) {
super.startLoading();
} else if (TextUtils.isEmpty(getQueryString())) {
// Clear out any existing call shortcuts.