summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Shrauner <shrauner@google.com>2015-12-14 15:32:19 -0800
committerJay Shrauner <shrauner@google.com>2015-12-14 15:46:45 -0800
commitb3e1537ec563cf343f46c643a84d67078c44dabf (patch)
tree36589cf57100956e20d8ce840400365b77689ebc
parent524d87169becc3137963d1c7ebba3493d0fa5e1d (diff)
Fix NPE in startLoading
Check for null activity. Bug:26183802 Change-Id: Ic1bdae3611513f43b5556145ea72aaf22d602a74
-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.