diff options
| author | 2019-04-19 15:33:53 +0000 | |
|---|---|---|
| committer | 2019-04-19 15:33:53 +0000 | |
| commit | cc469a276bc5f77b6296229bb89473541ffec47e (patch) | |
| tree | 38f8c772f20c1b1d16a876e5db4b53ed54badb05 | |
| parent | 31c89ed72e8d74283756b1818d8c3a1c3422b1ff (diff) | |
| parent | 8e99c7b6e20b95fa442557e8d7cbf69a345d2d15 (diff) | |
Merge "Add CallLog provider loggging to check for app-ops denial."
| -rw-r--r-- | core/java/android/provider/CallLog.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index ef28f07e817f..0827fd6e725e 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -967,6 +967,23 @@ public class CallLog { // spam the call log with its own entries, causing entries from Telephony to be // removed. final Uri result = resolver.insert(uri, values); + if (result != null) { + String lastPathSegment = result.getLastPathSegment(); + // When inserting into the call log, if ContentProvider#insert detect an appops + // denial a non-null "silent rejection" URI is returned which ends in 0. + // Example: content://call_log/calls/0 + // The 0 in the last part of the path indicates a fake call id of 0. + // A denial when logging calls from the platform is bad; there is no other + // logging to indicate that this has happened so we will check for that scenario + // here and log a warning so we have a hint as to what is going on. + if (lastPathSegment != null && lastPathSegment.equals("0")) { + Log.w(LOG_TAG, "Failed to insert into call log due to appops denial;" + + " resultUri=" + result); + } + } else { + Log.w(LOG_TAG, "Failed to insert into call log; null result uri."); + } + if (values.containsKey(PHONE_ACCOUNT_ID) && !TextUtils.isEmpty(values.getAsString(PHONE_ACCOUNT_ID)) && values.containsKey(PHONE_ACCOUNT_COMPONENT_NAME) |