1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-03 13:54:09 +00:00

Speed notification is a pro feature

This commit is contained in:
M66B 2016-07-23 08:48:29 +02:00
parent ede7219684
commit ca4fbbcda3

View file

@ -21,6 +21,7 @@ package eu.faircode.netguard;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.preference.PreferenceManager;
@ -64,7 +65,10 @@ public class ServiceTileGraph extends TileService implements SharedPreferences.O
// Check state
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
boolean stats = !prefs.getBoolean("show_stats", false);
prefs.edit().putBoolean("show_stats", stats).apply();
if (stats && !IAB.isPurchased(ActivityPro.SKU_SPEED, this))
startActivity(new Intent(this, ActivityPro.class));
else
prefs.edit().putBoolean("show_stats", stats).apply();
ServiceSinkhole.reloadStats("tile", this);
}
}