use of android.content.SharedPreferences in project iosched by google.
the class UIUtils method isNotificationFiredForBlock.
// Shows whether a notification was fired for a particular session time block. In the
// event that notification has not been fired yet, return false and set the bit.
public static boolean isNotificationFiredForBlock(Context context, String blockId) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
final String key = String.format("notification_fired_%s", blockId);
boolean fired = sp.getBoolean(key, false);
sp.edit().putBoolean(key, true).apply();
return fired;
}
use of android.content.SharedPreferences in project iosched by google.
the class AccountUtils method clearActiveAccount.
public static void clearActiveAccount(final Context context) {
LOGD(TAG, "Clearing active account");
SharedPreferences sp = getSharedPreferences(context);
sp.edit().remove(PREF_ACTIVE_ACCOUNT).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class AccountUtils method setPlusCoverUrl.
public static void setPlusCoverUrl(final Context context, final String accountName, String coverPhotoUrl) {
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_PLUS_COVER_URL), coverPhotoUrl).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class AccountUtils method setPlusProfileId.
public static void setPlusProfileId(final Context context, final String accountName, final String profileId) {
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_PLUS_PROFILE_ID), profileId).apply();
}
use of android.content.SharedPreferences in project iosched by google.
the class AccountUtils method setAuthToken.
public static void setAuthToken(final Context context, final String accountName, final String authToken) {
LOGI(TAG, "Auth token of length " + (TextUtils.isEmpty(authToken) ? 0 : authToken.length()) + " for " + accountName);
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putString(makeAccountSpecificPrefKey(accountName, PREFIX_PREF_AUTH_TOKEN), authToken).apply();
LOGV(TAG, "Auth Token: " + authToken);
}
Aggregations