<commit_before>/* 
 * Copyright (C) 2013-2014 www.Andbrain.com 
 * Faster and more easily to create android apps
 * 
 * */
package com.mady.wifi.api;

import android.content.Context;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.widget.Toast;

import java.util.List;


public class ScanTimerSimple extends ScanTimer {
    List<ScanResult> mResults;
    WifiManager mWifiManager;

    public ScanTimerSimple(Context c) {
        super(c);
        mWifiManager = (WifiManager) c.getSystemService(Context.WIFI_SERVICE);

    }

    public ScanTimerSimple(long interval, long duration, Context c) {
        super(interval, duration, c);
        mWifiManager = (WifiManager) c.getSystemService(Context.WIFI_SERVICE);

    }

    /**
     * This method is called periodically with the interval set as the delay between subsequent calls.
     */

    @Override
    protected void onTick() {
        scanNetworks();
        if (mResults != null) {
            List<ScanResult> results2 = mResults;

            for (ScanResult result : results2) {
                Toast.makeText(mContext, result.SSID + " " + result.level,
                        Toast.LENGTH_SHORT).show();
            }
        }

    }

    @Override
    protected void onFinish() {

    }

    public void scanNetworks() {
        boolean scan = mWifiManager.startScan();

        if (scan) {
            mResults = mWifiManager.getScanResults();


        } else
            switch (mWifiManager.getWifiState()) {
                case WifiManager.WIFI_STATE_DISABLING:
                    Toast.makeText(mContext, "wifi disabling", Toast.LENGTH_LONG).show();
                    break;
                case WifiManager.WIFI_STATE_DISABLED:
                    Toast.makeText(mContext, "wifi disabled", Toast.LENGTH_LONG).show();
                    break;
                case WifiManager.WIFI_STATE_ENABLING:
                    Toast.makeText(mContext, "wifi enabling", Toast.LENGTH_LONG).show();
                    break;
                case WifiManager.WIFI_STATE_ENABLED:
                    Toast.makeText(mContext, "wifi enabled", Toast.LENGTH_LONG).show();
                    break;
                case WifiManager.WIFI_STATE_UNKNOWN:
                    Toast.makeText(mContext, "wifi unknown state", Toast.LENGTH_LONG).show();
                    break;
            }

    }
}
<commit_msg>Remove Toast messages<commit_after>/* 
 * Copyright (C) 2013-2014 www.Andbrain.com 
 * Faster and more easily to create android apps
 * 
 * */
package com.mady.wifi.api;

import android.content.Context;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;

import java.util.List;


public class ScanTimerSimple extends ScanTimer {
    List<ScanResult> mResults;
    WifiManager mWifiManager;

    public ScanTimerSimple(Context c) {
        super(c);
        mWifiManager = (WifiManager) c.getSystemService(Context.WIFI_SERVICE);

    }

    public ScanTimerSimple(long interval, long duration, Context c) {
        super(interval, duration, c);
        mWifiManager = (WifiManager) c.getSystemService(Context.WIFI_SERVICE);

    }

    /**
     * This method is called periodically with the interval set as the delay between subsequent calls.
     */

    @Override
    protected void onTick() {
        scanNetworks();
    }

    @Override
    protected void onFinish() {

    }

    public void scanNetworks() {
        boolean scan = mWifiManager.startScan();

        if (scan) {
            mResults = mWifiManager.getScanResults();
        }

    }
}

{'fraction_non_alphanumeric': 0.0947867298578199, 'fraction_numerical': 0.005018120992472818, 'mean_word_length': 2.223719676549865, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7583713', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1017, 'n_words': 229}