Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Applying template with on demand restricting will enabled on demand r…
Browse files Browse the repository at this point in the history
…estricting setting

Closes #1727
  • Loading branch information
M66B committed Jun 16, 2014
1 parent 2e9fb10 commit 74aad42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions src/biz/bokhorst/xprivacy/PrivacyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<PRestriction> listPRestriction = new ArrayList<PRestriction>();
for (String rRestrictionName : listRestriction) {
if (clear)
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74aad42

Please sign in to comment.