diff --git a/CHANGELOG.md b/CHANGELOG.md index d1abfc66c..ad3811db1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Changelog **Next release** * Fixed applying template restricting dangerous functions ([issue](/../../issues/1728)) +* Applying template with on demand restricting will enabled on demand restricting setting ([issue](/../../issues/1727)) [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 91e001cf9..7f69fddfb 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyManager.java +++ b/src/biz/bokhorst/xprivacy/PrivacyManager.java @@ -522,6 +522,7 @@ public static void applyTemplate(int uid, String templateName, String restrictio // Apply template Util.log(null, Log.WARN, "Applying template=" + templateName); + boolean hasOndemand = false; List listPRestriction = new ArrayList(); for (String rRestrictionName : listRestriction) { if (clear) @@ -532,6 +533,7 @@ public static void applyTemplate(int uid, String templateName, String restrictio + "+ask"); boolean parentRestricted = parentValue.contains("true"); boolean parentAsked = (!ondemand || parentValue.contains("asked")); + hasOndemand = hasOndemand || !parentAsked; PRestriction parentMerge; if (clear) parentMerge = new PRestriction(uid, rRestrictionName, null, parentRestricted, parentAsked); @@ -564,6 +566,8 @@ public static void applyTemplate(int uid, String templateName, String restrictio } } setRestrictionList(listPRestriction); + if (hasOndemand) + PrivacyManager.setSetting(uid, PrivacyManager.cSettingOnDemand, Boolean.toString(true)); } // White listing