diff options
author | Sarmad Hashmi <mhashmi@google.com> | 2016-04-13 18:31:10 -0700 |
---|---|---|
committer | Sarmad Hashmi <mhashmi@google.com> | 2016-04-13 18:45:05 -0700 |
commit | 590352b0f2a5e702c01e88066db9cf9545b74117 (patch) | |
tree | 7eb9456b947afe4b636c3310c3a5966256800074 /src/com/android | |
parent | e2c7405ced75bd5a48ae4306e5c851e1cdfa2c4b (diff) |
Fix crash on call blocking settings open with no contacts permission.
+Check if app has CONTACTS permission before querying contacts database
Fixes: 27977009
Change-Id: If6ed7c31b6a94383d1d3a6a888520b6ed400b037
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/dialer/filterednumber/FilteredNumbersUtil.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java index 498b10a45..35d6f8d25 100644 --- a/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java +++ b/src/com/android/dialer/filterednumber/FilteredNumbersUtil.java @@ -32,6 +32,7 @@ import android.text.TextUtils; import android.widget.Toast; import com.android.contacts.common.testing.NeededForTesting; +import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.R; import com.android.dialer.compat.FilteredNumberCompat; import com.android.dialer.database.FilteredNumberAsyncQueryHandler; @@ -124,7 +125,7 @@ public class FilteredNumbersUtil { final AsyncTask task = new AsyncTask<Object, Void, Boolean>() { @Override public Boolean doInBackground(Object[] params) { - if (context == null) { + if (context == null || !PermissionsUtil.hasContactsPermissions(context)) { return false; } |