Store the date the user asked for being asked again later.
@param context
170503
private static void storeAskLaterDate(final Context context) {
        SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        Editor editor = pref.edit();
        editor.putLong(KEY_ASK_LATER_DATE, System.currentTimeMillis());
        editor.apply();
    }
104191
private void setDateTimeNow() {
        final Date dt = new Date();

        this.dateTime = MetaElement.DF_DATE.format(dt) +
                "T" + MetaElement.DF_TIME.format(dt);
    }
1279158
public static void onCreate(Context context) {
        SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        Editor editor = pref.edit();
        // If it is the first launch, save the date in shared preference.
        if (pref.getLong(KEY_INSTALL_DATE, 0) == 0L) {
            storeInstallDate(context, editor);
        }
        // Increment launch times
        int launchTimes = pref.getInt(KEY_LAUNCH_TIMES, 0);
        launchTimes++;
        editor.putInt(KEY_LAUNCH_TIMES, launchTimes);
        log("Launch times; " + launchTimes);

        editor.apply();

        mInstallDate = new Date(pref.getLong(KEY_INSTALL_DATE, 0));
        mLaunchTimes = pref.getInt(KEY_LAUNCH_TIMES, 0);
        mOptOut = pref.getBoolean(KEY_OPT_OUT, false);
        mAskLaterDate = new Date(pref.getLong(KEY_ASK_LATER_DATE, 0));

        printStatus(context);
    }
215436
private void setAllowedDate(final long date) {
        mAllowedDate = date;
        if (mSharedPreferences == null) {
            mSharedPreferences = mContext.getSharedPreferences(
                    PREFERENCES_GEOCODER, Context.MODE_PRIVATE);
        }
        final Editor e = mSharedPreferences.edit();
        e.putLong(KEY_ALLOW, date);
        e.apply();
    }
381210
public void reloadUsers(int contextId) {
		List<User> users = new ArrayList<User>(usersExtension.getContextUserAuthManager(contextId).getUsers());
		tableModel = new UsersSelectTableModel(users);
		this.setModel(tableModel);
	}
267086
protected void beforeSend(RpcInternalContext context, SofaRequest request) {
        currentRequests.incrementAndGet();
        context.setLocalAddress(localAddress());
    }
688989
public void setEnd(Date endDate) {

        if ((null == endDate) || getStart().after(endDate)) {
            m_explicitEnd = null;
        } else {
            m_explicitEnd = endDate;
        }
    }
1169974
public Date getDate() {
        if (date == null) {
            if (getContext() != null) {
                date = context.now();
            }
        }
        return date;
    }
1031659
public Object saveState(FacesContext context) {
        if (context == null) {
            throw new NullPointerException();
        }
        if (!initialStateMarked()) {
            Object values[] = new Object[1];
            values[0] = validationGroups;
            return values;
        }
        return null;
    }
1025894
public Object saveTransientState(FacesContext context)
    {
        TransientStateHelper helper = getTransientStateHelper(false);

        return (helper == null) ? null : helper.saveTransientState(context);
    }
968296
protected void setContext(Context context) throws CpoException {
    try {
      if (context == null) {
        context_ = new InitialContext();
      } else {
        context_ = context;
      }
    } catch (NamingException e) {
      throw new CpoException("Error setting Context", e);
    }
  }
638224
private synchronized void retainEvaluator(final ActiveContext context) {
    if (scheduler.hasPendingTasks()) {
      scheduler.submitTask(context);
    } else if (nActiveEval > 1) {
      nActiveEval--;
      context.close();
    } else {
      state = State.READY;
      waitForCommands(context);
    }
  }
617225
public void setHandler(String contextId, Runnable action) {

        if (contextId != null) {
            m_createFunctions.put(contextId, action);
        }
    }
1340051
protected void onBeforeRender() {
        super.onBeforeRender();
        if (runtimeModel.isEdit()) {
            for (QueryParameter parameter : convertMap.values()) {
                populateDependentParameters(parameter, null);
            }
        }
    }
261894
protected void afterSend(RpcInternalContext context, SofaRequest request) {
        currentRequests.decrementAndGet();
        int cost = context.getStopWatch().tick().read();
        context.setAttachment(RpcConstants.INTERNAL_KEY_REQ_SERIALIZE_TIME, cost);
        if (EventBus.isEnable(ClientAfterSendEvent.class)) {
            EventBus.post(new ClientAfterSendEvent(request));
        }
    }
1037339
private void saveToContext(Context context, boolean updateSiteStructure) {
		ParameterParser urlParamParser = context.getUrlParamParser();
		ParameterParser formParamParser = context.getPostParamParser();
		List<String> structParams = new ArrayList<String>();
		List<StructuralNodeModifier> ddns = new ArrayList<StructuralNodeModifier>();
		
		for (StructuralNodeModifier snm : this.ddnTableModel.getElements()) {
			if (snm.getType().equals(StructuralNodeModifier.Type.StructuralParameter)) {
				structParams.add(snm.getName());
			} else {
				ddns.add(snm);
			}
		}

		if (urlParamParser instanceof StandardParameterParser) {
			StandardParameterParser urlStdParamParser = (StandardParameterParser) urlParamParser;
			urlStdParamParser.setKeyValuePairSeparators(this.getUrlKvPairSeparators().getText());
			urlStdParamParser.setKeyValueSeparators(this.getUrlKeyValueSeparators().getText());

			urlStdParamParser.setStructuralParameters(structParams);

			context.setUrlParamParser(urlStdParamParser);
			urlStdParamParser.setContext(context);
		}
		if (formParamParser instanceof StandardParameterParser) {
			StandardParameterParser formStdParamParser = (StandardParameterParser) formParamParser;
			formStdParamParser.setKeyValuePairSeparators(this.getPostKvPairSeparators().getText());
			formStdParamParser.setKeyValueSeparators(this.getPostKeyValueSeparators().getText());
			context.setPostParamParser(formStdParamParser);
			formStdParamParser.setContext(context);
		}
		
		context.setDataDrivenNodes(ddns);
		
		if (updateSiteStructure) {
			context.restructureSiteTree();
		}
	}
253841
static void saveCurrentSession(Context context, LogMonitorSession session) {
		if (context == null) {
			throw new IllegalArgumentException("Context is null");
		}

		if (session == null) {
			throw new IllegalArgumentException("Session is null");
		}

		SharedPreferences prefs = getPrefs(context);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putString(PREFS_KEY_EMAIL_RECIPIENTS, StringUtils.join(session.emailRecipients));
		editor.apply();
	}