<commit_before>package sk.henrichg.phoneprofilesplus;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.LocalBroadcastManager;

import java.util.List;

public class EventsService extends IntentService
{
    Context context;
    DataWrapper dataWrapper;
    String broadcastReceiverType;

    //public static boolean restartAtEndOfEvent = false;
    public static boolean eventsProcessed;

    private int callEventType;
    public static int oldRingerMode;
    public static int oldSystemRingerMode;
    public static int oldZenMode;
    public static String oldRingtone;
    public static String oldNotificationTone;

    static final String EXTRA_BROADCAST_RECEIVER_TYPE = "broadcast_receiver_type";
    static final String EXTRA_EVENT_NOTIFICATION_POSTED_REMOVED = "event_notification_posted_removed";
    static final String EXTRA_EVENT_SMS_PHONE_NUMBER = "event_sms_phone_number";
    static final String EXTRA_EVENT_SMS_DATE = "event_sms_date";
    static final String EXTRA_SIMULATE_RINGING_CALL = "simulate_ringing_call";
    static final String EXTRA_OLD_RINGER_MODE = "old_ringer_mode";
    static final String EXTRA_OLD_SYSTEM_RINGER_MODE = "old_system_ringer_mode";
    static final String EXTRA_OLD_ZEN_MODE = "old_zen_mode";
    static final String EXTRA_OLD_RINGTONE = "old_ringtone";
    static final String EXTRA_EVENT_NFC_DATE = "event_nfc_date";
    static final String EXTRA_EVENT_NFC_TAG_NAME = "event_nfc_tag_name";
    static final String EXTRA_EVENT_RADIO_SWITCH_TYPE = "event_radio_switch_type";
    static final String EXTRA_EVENT_RADIO_SWITCH_STATE = "event_radio_switch_state";
    static final String EXTRA_SIMULATE_NOTIFICATION_TONE = "simulate_notification_tone";
    static final String EXTRA_OLD_NOTIFICATION_TONE = "old_notification_tone";


    //public static ArrayList<Profile> mergedProfiles = null;
    //public static Profile oldActivatedProfile = null;

    //public static final String BROADCAST_RECEIVER_TYPE_NO_BROADCAST_RECEIVER = "noBroadcastReceiver";

    public EventsService() {
        super("EventsService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {

        //Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler());
<commit_msg>Fixed FC: Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference                  at sk.henrichg.phoneprofilesplus.EventsService.onHandleIntent(EventsService.java:66)<commit_after>package sk.henrichg.phoneprofilesplus;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.AudioManager;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.LocalBroadcastManager;

import java.util.List;

public class EventsService extends IntentService
{
    Context context;
    DataWrapper dataWrapper;
    String broadcastReceiverType;

    //public static boolean restartAtEndOfEvent = false;
    public static boolean eventsProcessed;

    private int callEventType;
    public static int oldRingerMode;
    public static int oldSystemRingerMode;
    public static int oldZenMode;
    public static String oldRingtone;
    public static String oldNotificationTone;

    static final String EXTRA_BROADCAST_RECEIVER_TYPE = "broadcast_receiver_type";
    static final String EXTRA_EVENT_NOTIFICATION_POSTED_REMOVED = "event_notification_posted_removed";
    static final String EXTRA_EVENT_SMS_PHONE_NUMBER = "event_sms_phone_number";
    static final String EXTRA_EVENT_SMS_DATE = "event_sms_date";
    static final String EXTRA_SIMULATE_RINGING_CALL = "simulate_ringing_call";
    static final String EXTRA_OLD_RINGER_MODE = "old_ringer_mode";
    static final String EXTRA_OLD_SYSTEM_RINGER_MODE = "old_system_ringer_mode";
    static final String EXTRA_OLD_ZEN_MODE = "old_zen_mode";
    static final String EXTRA_OLD_RINGTONE = "old_ringtone";
    static final String EXTRA_EVENT_NFC_DATE = "event_nfc_date";
    static final String EXTRA_EVENT_NFC_TAG_NAME = "event_nfc_tag_name";
    static final String EXTRA_EVENT_RADIO_SWITCH_TYPE = "event_radio_switch_type";
    static final String EXTRA_EVENT_RADIO_SWITCH_STATE = "event_radio_switch_state";
    static final String EXTRA_SIMULATE_NOTIFICATION_TONE = "simulate_notification_tone";
    static final String EXTRA_OLD_NOTIFICATION_TONE = "old_notification_tone";


    //public static ArrayList<Profile> mergedProfiles = null;
    //public static Profile oldActivatedProfile = null;

    //public static final String BROADCAST_RECEIVER_TYPE_NO_BROADCAST_RECEIVER = "noBroadcastReceiver";

    public EventsService() {
        super("EventsService");

        // if enabled is true, onStartCommand(Intent, int, int) will return START_REDELIVER_INTENT,
        // so if this process dies before onHandleIntent(Intent) returns, the process will be restarted
        // and the intent redelivered. If multiple Intents have been sent, only the most recent one
        // is guaranteed to be redelivered.
        setIntentRedelivery(true);
    }

    @Override
    protected void onHandleIntent(Intent intent) {

        //Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler());

{'fraction_non_alphanumeric': 0.061853832442067734, 'fraction_numerical': 0.00071301247771836, 'mean_word_length': 5.11886586695747, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6037905', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1619, 'n_words': 394}