<commit_before>package it.angelic.receivers;

import it.angelic.soulissclient.SoulissClient;
import it.angelic.soulissclient.helpers.SoulissPreferenceHelper;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

public class NetworkStateReceiver extends BroadcastReceiver {
	private static final String TAG = "Souliss:Network Monitor";
	private SoulissPreferenceHelper opzioni;

	
	
	public void onReceive(Context context, Intent intent) {
		// super.onReceive(context, intent);
		// final SharedPreferences customSharedPreference = context
		// .getSharedPreferences("SoulissPrefs", Activity.MODE_PRIVATE);
		if (opzioni == null)
			opzioni = SoulissClient.getOpzioni();
		//solo if UDP?
		opzioni.clearCachedAddress();
		SharedPreferences.Editor editor = opzioni.getCustomPref().edit();
		Log.d(TAG, "Network connectivity change");
		if (intent.getExtras() != null) {
			NetworkInfo ni = ((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
	        //NetworkInfo ni = (NetworkInfo) intent.getExtras().get(ConnectivityManager.EXTRA_NETWORK_INFO);
			storeNetworkInfo(ni, opzioni);
			Log.i(TAG, "Calling setBestAddress to check connectivity");
			opzioni.setBestAddress();
		}
		if (intent.getExtras().getBoolean(ConnectivityManager.EXTRA_NO_CONNECTIVITY, Boolean.FALSE)) {
			Log.w(TAG, "There's no network connectivity");
			if (opzioni.getCustomPref().contains("connection"))
				editor.remove("connection");<commit_msg>test other connection<commit_after>package it.angelic.receivers;

import it.angelic.soulissclient.SoulissClient;
import it.angelic.soulissclient.helpers.SoulissPreferenceHelper;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;

public class NetworkStateReceiver extends BroadcastReceiver {
	private static final String TAG = "Souliss:Network Monitor";
	private SoulissPreferenceHelper opzioni;

	public void onReceive(Context context, Intent intent) {
		// super.onReceive(context, intent);
		// final SharedPreferences customSharedPreference = context
		// .getSharedPreferences("SoulissPrefs", Activity.MODE_PRIVATE);
		if (opzioni == null)
			opzioni = SoulissClient.getOpzioni();
		//solo if UDP?
		opzioni.clearCachedAddress();
		SharedPreferences.Editor editor = opzioni.getCustomPref().edit();
		Log.d(TAG, "Network connectivity change");
		if (intent.getExtras() != null) {
			NetworkInfo ni = ((ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
	        //NetworkInfo ni = (NetworkInfo) intent.getExtras().get(ConnectivityManager.EXTRA_NETWORK_INFO);
			storeNetworkInfo(ni, opzioni);
			Log.i(TAG, "Calling setBestAddress to check connectivity");
			opzioni.setBestAddress();
		}
		if (intent.getExtras().getBoolean(ConnectivityManager.EXTRA_NO_CONNECTIVITY, Boolean.FALSE)) {
			Log.w(TAG, "There's no network connectivity");
			if (opzioni.getCustomPref().contains("connection"))
				editor.remove("connection");
{'fraction_non_alphanumeric': 0.11097780443911218, 'fraction_numerical': 0.0, 'mean_word_length': 6.110874200426439, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5397358', 'n_tokens_mistral': 1047, 'n_tokens_neox': 973, 'n_words': 191}