Example #1
0
/**
 * Save the radio states to persistant storage
 *
 * @param online_states The online radio states to store
 * @param offline_states The offline radio states to store
 * @return TRUE on success, FALSE on failure
 */
static gboolean save_radio_states(const gulong online_states,
				  const gulong offline_states)
{
	gboolean status = FALSE;

	if (mce_are_settings_locked() == TRUE) {
		mce_log(LL_WARN,
			"Cannot save radio states; backup/restore "
			"or device clear/factory reset pending");
		goto EXIT;
	}

	status = mce_write_number_string_to_file_atomic(MCE_ONLINE_RADIO_STATES_PATH, online_states);

	if (status == FALSE)
		goto EXIT;

	status = mce_write_number_string_to_file_atomic(MCE_OFFLINE_RADIO_STATES_PATH, offline_states);

EXIT:
	return status;
}
Example #2
0
/** Save the radio states to persistant storage
 */
static void
mrs_save_radio_states(void)
{
	const guint online_states  = active_radio_states;
	const guint offline_states = saved_radio_states;

	/* FIXME: old maemo backup/restore handling - can be removed? */
	if (mce_are_settings_locked() == TRUE) {
		mce_log(LL_WARN,
			"Cannot save radio states; backup/restore "
			"or device clear/factory reset pending");
		goto EXIT;
	}

	mce_write_number_string_to_file_atomic(MCE_ONLINE_RADIO_STATES_PATH,
					       online_states);
	mce_write_number_string_to_file_atomic(MCE_OFFLINE_RADIO_STATES_PATH,
					       offline_states);

EXIT:
	return;
}