diff --git a/CHANGELOG.md b/CHANGELOG.md index 51e2f2e04..2645c6dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ Changelog [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) +* Fixed restricting profile (owner name, etc) ([issue](/../../issues/1610)) + **Version 2.0.13 TEST** * Fixed error message for Android versions below JellyBean MR1 (SDK 17) ([issue](/../../issues/1602)) diff --git a/src/biz/bokhorst/xprivacy/XContentResolver.java b/src/biz/bokhorst/xprivacy/XContentResolver.java index c84aa2502..deb2ef610 100644 --- a/src/biz/bokhorst/xprivacy/XContentResolver.java +++ b/src/biz/bokhorst/xprivacy/XContentResolver.java @@ -213,7 +213,7 @@ private void handleUriAfter(XParam param) throws Throwable { String[] components = uri.replace("content://com.android.", "").split("/"); String methodName = components[0] + "/" + components[1].split("\\?")[0]; if (methodName.equals("contacts/contacts") || methodName.equals("contacts/data") - || methodName.equals("contacts/phone_lookup") || methodName.equals("contacts/raw_contacts")) + || methodName.equals("contacts/phone_lookup") || methodName.equals("contacts/raw_contacts")) { if (isRestrictedExtra(param, PrivacyManager.cContacts, methodName, uri)) { // Get ID from URL if any int urlid = -1; @@ -254,6 +254,22 @@ private void handleUriAfter(XParam param) throws Throwable { param.setResult(result); cursor.close(); } + } else { + methodName = null; + if (uri.startsWith("content://com.android.contacts/profile")) + methodName = "contacts/profile"; + else + methodName = "ContactsProvider2"; // fall-back + + if (methodName != null) + if (isRestrictedExtra(param, PrivacyManager.cContacts, methodName, uri)) { + // Return empty cursor + MatrixCursor result = new MatrixCursor(cursor.getColumnNames()); + result.respond(cursor.getExtras()); + param.setResult(result); + cursor.close(); + } + } } else { // Other uri restrictions @@ -279,16 +295,6 @@ else if (uri.startsWith("content://contacts/people")) { methodName = "contacts/people"; } - else if (uri.startsWith("content://com.android.contacts/profile")) { - restrictionName = PrivacyManager.cContacts; - methodName = "contacts/profile"; - } - - else if (uri.startsWith("content://com.android.contacts")) { - restrictionName = PrivacyManager.cContacts; - methodName = "ContactsProvider2"; // fall-back - } - else if (uri.startsWith("content://downloads")) { restrictionName = PrivacyManager.cBrowser; methodName = "Downloads";