diff options
author | Yorke Lee <yorkelee@google.com> | 2015-05-02 22:22:54 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-05-11 11:39:05 -0700 |
commit | 4aece9536ed64da965fd42da07a393f935abd6b1 (patch) | |
tree | f7b55745b75b1f2bcaa40fddd4c1701e72b92d18 /src/com/android/dialer/CallDetailActivity.java | |
parent | 81c93829582aac6cd8717511216611f37cc9c4c5 (diff) |
Dynamically check for permission denials
Don't crash when performing certain operations that the
dialer might not have permissions to execute:
* Access voicemail provider
* Certain TelecomManager methods
Add a class TelecomUtil that checks for permissions/default
dialer status, and handles the privileged operations
appropriately.
Bug: 20266292
Change-Id: Ibe8a85440b9ca20169b5ce3be24d1a385caaebb6
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 7a23944a0..0a295c4fe 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -66,6 +66,7 @@ import com.android.dialer.util.AsyncTaskExecutor; import com.android.dialer.util.AsyncTaskExecutors; import com.android.dialer.util.CallIntentUtil; import com.android.dialer.util.DialerUtils; +import com.android.dialer.util.TelecomUtil; import com.android.dialer.voicemail.VoicemailPlaybackFragment; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelper.StatusMessage; @@ -307,7 +308,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware final int numIds = ids == null ? 0 : ids.length; final Uri[] uris = new Uri[numIds]; for (int index = 0; index < numIds; ++index) { - uris[index] = ContentUris.withAppendedId(Calls.CONTENT_URI_WITH_VOICEMAIL, ids[index]); + uris[index] = ContentUris.withAppendedId( + TelecomUtil.getCallLogUri(CallDetailActivity.this), ids[index]); } return uris; } @@ -670,7 +672,8 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware new AsyncTask<Void, Void, Void>() { @Override public Void doInBackground(Void... params) { - getContentResolver().delete(Calls.CONTENT_URI_WITH_VOICEMAIL, + getContentResolver().delete( + TelecomUtil.getCallLogUri(CallDetailActivity.this), Calls._ID + " IN (" + callIds + ")", null); return null; } |