From 26b2eaf546508759ef6e0cfa0d4e683fa86daba6 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 5 Jan 2016 22:43:18 +0100 Subject: [PATCH] Check if log purchased Closes #216 --- .../java/eu/faircode/netguard/ActivitySettings.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java index 51f562cf..ef0aa83a 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java +++ b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java @@ -323,10 +323,16 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere prefs.edit().putBoolean("show_system", prefs.getBoolean(name, false)).apply(); SinkholeService.reload(null, "setting changed", this); - } else if ("log".equals(name)) - SinkholeService.reload(null, "setting changed", this); + } else if ("log".equals(name)) { + if (prefs.getBoolean(name, false) && !IAB.isPurchased(ActivityPro.SKU_LOG, this)) { + prefs.edit().putBoolean(name, false).apply(); + ((SwitchPreference) getPreferenceScreen().findPreference(name)).setChecked(false); + startActivity(new Intent(this, ActivityPro.class)); + return; + } else + SinkholeService.reload(null, "setting changed", this); - else if ("auto_enable".equals(name)) + } else if ("auto_enable".equals(name)) getPreferenceScreen().findPreference(name).setTitle(getString(R.string.setting_auto, prefs.getString(name, "0"))); else if ("screen_delay".equals(name))