Allow hiding pro banner one day

This commit is contained in:
M66B
2019-11-23 11:39:34 +01:00
parent 7077be3f5a
commit f5aebd93b9
6 changed files with 66 additions and 6 deletions

View File

@@ -52,6 +52,7 @@ public class ServiceUI extends IntentService {
static final int PI_IGNORED = 10;
static final int PI_THREAD = 11;
static final int PI_WAKEUP = 12;
static final int PI_DAILY = 13;
public ServiceUI() {
this(ServiceUI.class.getName());
@@ -151,6 +152,10 @@ public class ServiceUI extends IntentService {
// https://developer.android.com/reference/android/app/AlarmManager
onWakeup(id);
break;
case "daily":
onDaily();
break;
default:
throw new IllegalArgumentException("Unknown UI action: " + parts[0]);
}
@@ -403,4 +408,9 @@ public class ServiceUI extends IntentService {
db.endTransaction();
}
}
private void onDaily() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.edit().remove("banner").apply();
}
}