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

Commit

Permalink
Fixed on demand restricting for dangerous methods with whitelists
Browse files Browse the repository at this point in the history
Fixed #1653
  • Loading branch information
M66B committed May 17, 2014
1 parent 116ee6b commit e064e3e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 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 displaying contacts without display name ([issue](/../../issues/1660))
* Fixed on demand restricting for dangerous methods with whitelists ([issue](/../../issues/1653))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

Expand Down
4 changes: 2 additions & 2 deletions src/biz/bokhorst/xprivacy/PrivacyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ public static void applyTemplate(int uid, String restrictionName, boolean method
Boolean.toString(parentRestricted && (hook.isDangerous() ? dangerous : true))
+ (parentAsked ? "+asked" : "+ask"), false);
boolean restricted = value.contains("true");
boolean asked = value.contains("asked");
boolean asked = (!ondemand || value.contains("asked"));
if ((parentRestricted && !restricted) || (!parentAsked && asked))
listPRestriction.add(new PRestriction(uid, rRestrictionName, hook.getName(), parentRestricted
&& restricted, parentAsked || asked || !ondemand));
&& restricted, parentAsked || asked));
}
}
setRestrictionList(listPRestriction);
Expand Down
2 changes: 1 addition & 1 deletion src/biz/bokhorst/xprivacy/PrivacyService.java
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public PRestriction getRestriction(final PRestriction restriction, boolean usage
if (!methodFound && hook != null && hook.isDangerous())
if (!getSettingBool(userId, PrivacyManager.cSettingDangerous, false)) {
mresult.restricted = false;
mresult.asked = true;
mresult.asked = (hook.whitelist() == null);
}

// Check whitelist
Expand Down

0 comments on commit e064e3e

Please sign in to comment.