<commit_before>package com.ianhanniballake.contractiontimer.service;

import android.app.Service;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

import com.google.android.apps.analytics.GoogleAnalyticsTracker;

/**
 * Starts and stops the Google Analytics session based on the number of attached
 * activities
 */
public class AnalyticsService extends Service
{
	/**
	 * Valid Google Analytics Web Property ID to log analytics to
	 */
	private final static String ANALYTICS_PROPERTY_ID = "UA-25785295-1";

	@Override
	public IBinder onBind(final Intent intent)
	{
		Log.d(getClass().getSimpleName(), "Binding service");
		final GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker
				.getInstance();
		// Start the tracker in manual dispatch mode
		tracker.startNewSession(ANALYTICS_PROPERTY_ID, getApplicationContext());
		tracker.setAnonymizeIp(true);
		final ApplicationInfo appInfo = getApplicationContext()
				.getApplicationInfo();
		tracker.setDebug((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
		return new Binder();
	}

	@Override
	public boolean onUnbind(final Intent intent)
	{
		Log.d(getClass().getSimpleName(), "Unbinding service");
		final GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker
				.getInstance();
		tracker.dispatch();
		tracker.stopSession();
		return false;
	}
}
<commit_msg>Removes Analytics upload when in debug mode<commit_after>package com.ianhanniballake.contractiontimer.service;

import android.app.Service;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

import com.google.android.apps.analytics.GoogleAnalyticsTracker;

/**
 * Starts and stops the Google Analytics session based on the number of attached
 * activities
 */
public class AnalyticsService extends Service
{
	/**
	 * Valid Google Analytics Web Property ID to log analytics to
	 */
	private final static String ANALYTICS_PROPERTY_ID = "UA-25785295-1";

	@Override
	public IBinder onBind(final Intent intent)
	{
		Log.d(getClass().getSimpleName(), "Binding service");
		final GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker
				.getInstance();
		// Start the tracker in manual dispatch mode
		tracker.startNewSession(ANALYTICS_PROPERTY_ID, getApplicationContext());
		tracker.setAnonymizeIp(true);
		final ApplicationInfo appInfo = getApplicationContext()
				.getApplicationInfo();
		tracker.setDebug((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0);
		return new Binder();
	}

	@Override
	public boolean onUnbind(final Intent intent)
	{
		Log.d(getClass().getSimpleName(), "Unbinding service");
		final GoogleAnalyticsTracker tracker = GoogleAnalyticsTracker
				.getInstance();
		final ApplicationInfo appInfo = getApplicationContext()
				.getApplicationInfo();
		if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) == 0)
			tracker.dispatch();
		tracker.stopSession();
		return false;
	}
}

{'fraction_non_alphanumeric': 0.09717662508207485, 'fraction_numerical': 0.006894287590282338, 'mean_word_length': 5.282474226804124, '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': '3873768', 'n_tokens_mistral': 944, 'n_tokens_neox': 866, 'n_words': 223}