diff options
author | Jay Shrauner <shrauner@google.com> | 2015-12-14 15:32:19 -0800 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2015-12-14 15:46:45 -0800 |
commit | b3e1537ec563cf343f46c643a84d67078c44dabf (patch) | |
tree | 36589cf57100956e20d8ce840400365b77689ebc /src/com/android/dialer/list | |
parent | 524d87169becc3137963d1c7ebba3493d0fa5e1d (diff) |
Fix NPE in startLoading
Check for null activity.
Bug:26183802
Change-Id: Ic1bdae3611513f43b5556145ea72aaf22d602a74
Diffstat (limited to 'src/com/android/dialer/list')
-rw-r--r-- | src/com/android/dialer/list/SearchFragment.java | 8 |
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. |