From b45931625b1bfd1fe1e503ebe8f5b7bf5a588017 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 30 Aug 2014 08:17:12 +0200 Subject: [PATCH] Added category merge/reset Fixes #1909 --- CHANGELOG.md | 1 + src/biz/bokhorst/xprivacy/PrivacyManager.java | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6de59653..22b9d3039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ Version 3.x will be available with a [pro license](http://www.xprivacy.eu/) only * Improved database locking ([pull request](/../../issues/1939)) * Changed settings dialog to settings activity ([pull request](/../../issues/1938)) * Moved flush button to expert mode section ([issue](/../../issues/1934)) +* Added category merge/reset ([issue](/../../issues/1909)) * Updated simplified Chinese translation [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/src/biz/bokhorst/xprivacy/PrivacyManager.java b/src/biz/bokhorst/xprivacy/PrivacyManager.java index 6596a0cae..87401ac70 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyManager.java +++ b/src/biz/bokhorst/xprivacy/PrivacyManager.java @@ -605,8 +605,13 @@ public static void applyTemplate(int uid, String templateName, String restrictio // Apply if (canRestrict(uid, Process.myUid(), rRestrictionName, null, true)) - listPRestriction.add(new PRestriction(uid, rRestrictionName, null, parentMerge.restricted - || parentRestricted, parentMerge.asked && parentAsked)); + if (invert && ((parentRestricted && parentMerge.restricted) || (!parentAsked && !parentMerge.asked))) { + listPRestriction.add(new PRestriction(uid, rRestrictionName, null, parentRestricted ? false + : parentMerge.restricted, !parentAsked ? true : parentMerge.asked)); + continue; // leave functions + } else + listPRestriction.add(new PRestriction(uid, rRestrictionName, null, parentMerge.restricted + || parentRestricted, parentMerge.asked && parentAsked)); // Childs if (methods)