From fc4b713d936be0e9e7440a9bd3a394f0ab7c9be5 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 16 Aug 2014 22:01:31 +0200 Subject: [PATCH] Cache category restriction result Refs #1885 --- src/biz/bokhorst/xprivacy/PrivacyService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/biz/bokhorst/xprivacy/PrivacyService.java b/src/biz/bokhorst/xprivacy/PrivacyService.java index 867c04db1..0225c6af6 100644 --- a/src/biz/bokhorst/xprivacy/PrivacyService.java +++ b/src/biz/bokhorst/xprivacy/PrivacyService.java @@ -569,6 +569,12 @@ else if (hook.getFrom() != null) { } // Update cache + CRestriction ckey = new CRestriction(cresult, null); + synchronized (mRestrictionCache) { + if (mRestrictionCache.containsKey(ckey)) + mRestrictionCache.remove(ckey); + mRestrictionCache.put(ckey, ckey); + } CRestriction ukey = new CRestriction(mresult, restriction.extra); synchronized (mRestrictionCache) { if (mRestrictionCache.containsKey(ukey))