diff options
author | Yorke Lee <yorkelee@google.com> | 2015-05-19 15:51:01 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-05-22 11:40:21 -0700 |
commit | c16ea5ad67bf454158b364dec2f26c95a879c350 (patch) | |
tree | d711fcd0374d8d82102f81ad74d6f94cd75729d8 /src/com/android/dialer/dialpad/SmartDialCursorLoader.java | |
parent | 5a194cd1f573d6c94a6b0e3e14cfabd69e42b856 (diff) |
Handle runtime permissions in Dialer
Conditionally disable the following features if the required
permissions are not available:
1) Display of all contacts
2) Display of speed dial
3) Caller ID in call log
4) Import/export contacts
5) Conversion of People.CONTENT_ITEM_TYPE and Phones.CONTENT_ITEM_TYPE
into a phone number (via DIAL intent)
6) UndemoteOutgoingCallReceiver
7) Contact Search
8) Contact lookup in call detail activity
9) Nearby places search
Bug: 20266292
Change-Id: I6d26902acb0eac407ae7bc18c11aa6ec57299506
Diffstat (limited to 'src/com/android/dialer/dialpad/SmartDialCursorLoader.java')
-rw-r--r-- | src/com/android/dialer/dialpad/SmartDialCursorLoader.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/dialer/dialpad/SmartDialCursorLoader.java b/src/com/android/dialer/dialpad/SmartDialCursorLoader.java index 372692eae..f83f18cd7 100644 --- a/src/com/android/dialer/dialpad/SmartDialCursorLoader.java +++ b/src/com/android/dialer/dialpad/SmartDialCursorLoader.java @@ -25,6 +25,7 @@ import android.net.Uri; import android.util.Log; import com.android.contacts.common.list.PhoneNumberListAdapter.PhoneQuery; +import com.android.contacts.common.util.PermissionsUtil; import com.android.dialer.database.DialerDatabaseHelper; import com.android.dialer.database.DialerDatabaseHelper.ContactNumber; import com.android.dialerbind.DatabaseHelperManager; @@ -77,6 +78,10 @@ public class SmartDialCursorLoader extends AsyncTaskLoader<Cursor> { Log.v(TAG, "Load in background " + mQuery); } + if (!PermissionsUtil.hasContactsPermissions(mContext)) { + return new MatrixCursor(PhoneQuery.PROJECTION_PRIMARY); + } + /** Loads results from the database helper. */ final DialerDatabaseHelper dialerDatabaseHelper = DatabaseHelperManager.getDatabaseHelper( mContext); |