Home | History | Annotate | Download | only in utils

Lines Matching refs:context

19 import android.content.Context;
56 private static boolean isInSystemSetupWizard(final Context context) {
59 context.getContentResolver(), Settings_Secure_USER_SETUP_COMPLETE);
69 static SharedPreferences getImportantNoticePreferences(final Context context) {
70 return context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE);
74 static int getCurrentImportantNoticeVersion(final Context context) {
75 return context.getResources().getInteger(R.integer.config_important_notice_version);
79 static int getLastImportantNoticeVersion(final Context context) {
80 return getImportantNoticePreferences(context).getInt(KEY_IMPORTANT_NOTICE_VERSION, 0);
83 public static int getNextImportantNoticeVersion(final Context context) {
84 return getLastImportantNoticeVersion(context) + 1;
87 private static boolean hasNewImportantNotice(final Context context) {
88 final int lastVersion = getLastImportantNoticeVersion(context);
89 return getCurrentImportantNoticeVersion(context) > lastVersion;
93 static boolean hasTimeoutPassed(final Context context, final long currentTimeInMillis) {
94 final SharedPreferences prefs = getImportantNoticePreferences(context);
106 public static boolean shouldShowImportantNotice(final Context context) {
107 if (!hasNewImportantNotice(context)) {
110 final String importantNoticeTitle = getNextImportantNoticeTitle(context);
114 if (isInSystemSetupWizard(context)) {
117 if (hasTimeoutPassed(context, System.currentTimeMillis())) {
118 updateLastImportantNoticeVersion(context);
124 public static void updateLastImportantNoticeVersion(final Context context) {
125 getImportantNoticePreferences(context)
127 .putInt(KEY_IMPORTANT_NOTICE_VERSION, getNextImportantNoticeVersion(context))
132 public static String getNextImportantNoticeTitle(final Context context) {
133 final int nextVersion = getNextImportantNoticeVersion(context);
134 final String[] importantNoticeTitleArray = context.getResources().getStringArray(
142 public static String getNextImportantNoticeContents(final Context context) {
143 final int nextVersion = getNextImportantNoticeVersion(context);
144 final String[] importantNoticeContentsArray = context.getResources().getStringArray(