make reminder a custom view, make push reminder

// FREEBIE
This commit is contained in:
Jake McGinty
2014-08-04 13:13:47 -07:00
parent eb4ac40051
commit de63b0dd96
12 changed files with 293 additions and 97 deletions

View File

@@ -55,6 +55,8 @@ public class TextSecurePreferences {
private static final String GCM_REGISTRATION_ID_PREF = "pref_gcm_registration_id";
private static final String GCM_REGISTRATION_ID_VERSION_PREF = "pref_gcm_registration_id_version";
private static final String PUSH_REGISTRATION_REMINDER_PREF = "pref_push_registration_reminder";
public static void setGcmRegistrationId(Context context, String registrationId) {
setStringPreference(context, GCM_REGISTRATION_ID_PREF, registrationId);
setIntegerPrefrence(context, GCM_REGISTRATION_ID_VERSION_PREF, Util.getCurrentApkReleaseVersion(context));
@@ -305,6 +307,14 @@ public class TextSecurePreferences {
return Integer.parseInt(getStringPreference(context, THREAD_TRIM_LENGTH, "500"));
}
public static long getLastPushReminderTime(Context context) {
return getLongPreference(context, PUSH_REGISTRATION_REMINDER_PREF, 0L);
}
public static void setLastPushReminderTime(Context context, long time) {
setLongPreference(context, PUSH_REGISTRATION_REMINDER_PREF, System.currentTimeMillis());
}
private static void setBooleanPreference(Context context, String key, boolean value) {
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean(key, value).apply();
}