Remove analytics

* Remove findbugs
* Remove localytics
* Remove crittercism
* Remove anonymous statistics menu entry
* Remove coarse location permission
pull/14/head
Alex Baker 11 years ago
parent d0ee6fe1ff
commit 79313d1b0d

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="crittercism">
<CLASSES>
<root url="jar://$PROJECT_DIR$/astrid/libs/crittercism_v3_0_7_sdkonly.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -1,9 +0,0 @@
<component name="libraryTable">
<library name="findbugs-annotations">
<CLASSES>
<root url="jar://$PROJECT_DIR$/astrid/libs/findbugs-annotations.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -389,7 +389,6 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
* whether to display a dialog
*/
protected void handleException(String tag, Exception e, boolean displayError) {
//TODO: When Crittercism supports it, report error to them
final Context context = ContextManager.getContext();
getUtilities().setLastError(e.toString(), "");

@ -18,7 +18,6 @@ abstract public class SyncV2Provider {
public class SyncExceptionHandler {
public void handleException(String tag, Exception e, String type) {
//TODO: When Crittercism supports it, report error to them
getUtilities().setLastError(e.toString(), type);
// occurs when application was closed

@ -26,8 +26,6 @@
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<!-- for backup -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- for analytics -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<!-- for google tasks -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
@ -191,11 +189,6 @@
android:screenOrientation="portrait"
android:theme="@android:style/Theme" />
<!-- Start of Crittercism.com Code -->
<activity android:name="com.crittercism.NotificationActivity"/>
<!-- End of Crittercism.com Code -->
<!-- ======================================================= Receivers = -->
<receiver android:name="com.todoroo.astrid.reminders.Notifications" />

@ -41,8 +41,6 @@
<orderEntry type="library" exported="" name="google-http-client" level="project" />
<orderEntry type="library" exported="" name="googleloginclient-helper" level="project" />
<orderEntry type="library" exported="" name="google-api-client" level="project" />
<orderEntry type="library" name="crittercism" level="project" />
<orderEntry type="library" name="findbugs-annotations" level="project" />
<orderEntry type="module" module-name="facebook" />
</component>
</module>

@ -1,96 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.localytics.android;
import android.text.format.DateUtils;
/**
* Build constants for the Localytics library.
* <p>
* This is not a public API.
*/
/* package */final class Constants
{
/**
* Version number of this library. This number is primarily important in terms of changes to the upload format.
*/
//@formatter:off
/*
* Version history:
*
* 1.6: Fixed network type reporting. Added reporting of app signature, device SDK level, device manufacturer, serial number.
* 2.0: New upload format.
*/
//@formatter:on
public static final String LOCALYTICS_CLIENT_LIBRARY_VERSION = "android_2.2"; //$NON-NLS-1$
/**
* The package name of the Localytics library.
*/
/*
* Note: This value cannot be changed without significant consequences to the data in the database.
*/
public static final String LOCALYTICS_PACKAGE_NAME = "com.localytics.android"; //$NON-NLS-1$
/**
* Maximum number of sessions to store on disk.
*/
public static final int MAX_NUM_SESSIONS = 10;
/**
* Maximum number of attributes per event session.
*/
public static final int MAX_NUM_ATTRIBUTES = 10;
/**
* Maximum characters in an event name or attribute key/value.
*/
public static final int MAX_NAME_LENGTH = 128;
/**
* Milliseconds after which a session is considered closed and cannot be reattached to.
* <p>
* For example, if the user opens an app, presses home, and opens the app again in less than {@link #SESSION_EXPIRATION}
* milliseconds, that will count as one session rather than two sessions.
*/
public static long SESSION_EXPIRATION = 15 * DateUtils.SECOND_IN_MILLIS;
/**
* logcat log tag
*/
public static final String LOG_TAG = "Localytics"; //$NON-NLS-1$
/**
* Boolean indicating whether logcat messages are enabled.
* <p>
* Before releasing a production version of an app, this should be set to false for privacy and performance reasons. When
* logging is enabled, sensitive information such as the device ID may be printed to the log.
*/
public static boolean IS_LOGGABLE = false;
/**
* Flag indicating whether runtime method parameter checking is performed.
*/
public static boolean ENABLE_PARAMETER_CHECKING = true;
/**
* Cached copy of the current Android API level
*
* @see DatapointHelper#getApiLevel()
*/
/*package*/ static final int CURRENT_API_LEVEL = DatapointHelper.getApiLevel();
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private Constants()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
}

@ -1,392 +0,0 @@
//@formatter:off
/**
* DatapointHelper.java Copyright (C) 2011 Char Software Inc., DBA Localytics This code is provided under the Localytics Modified
* BSD License. A copy of this license has been distributed in a file called LICENSE with this source code. Please visit
* www.localytics.com for more information.
*/
//@formatter:on
package com.localytics.android;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import android.Manifest.permission;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.util.Log;
/**
* Provides a number of static functions to aid in the collection and formatting of datapoints.
* <p>
* Note: this is not a public API.
*/
/* package */final class DatapointHelper
{
/**
* AndroidID known to be duplicated across many devices due to manufacturer bugs.
*/
private static final String INVALID_ANDROID_ID = "9774d56d682e549c"; //$NON-NLS-1$
/**
* The path to the device_id file in previous versions of the Localytics library
*/
private static final String LEGACY_DEVICE_ID_FILE = "/localytics/device_id"; //$NON-NLS-1$
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private DatapointHelper()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* @return current Android API level.
*/
/* package */static int getApiLevel()
{
try
{
// Although the Build.VERSION.SDK field has existed since API 1, it is deprecated and could be removed
// in the future. Therefore use reflection to retrieve it for maximum forward compatibility.
final Class<?> buildClass = Build.VERSION.class;
final String sdkString = (String) buildClass.getField("SDK").get(null); //$NON-NLS-1$
return Integer.parseInt(sdkString);
}
catch (final Exception e)
{
Log.w(Constants.LOG_TAG, "Caught exception", e); //$NON-NLS-1$
// Although probably not necessary, protects from the aforementioned deprecation
try
{
final Class<?> buildClass = Build.VERSION.class;
return buildClass.getField("SDK_INT").getInt(null); //$NON-NLS-1$
}
catch (final Exception ignore)
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Caught exception", ignore); //$NON-NLS-1$
}
}
}
// Worse-case scenario, assume Cupcake
return 3;
}
/**
* Gets a 1-way hashed value of the device's Android ID. This value is encoded using a SHA-256 one way hash and therefore
* cannot be used to determine what device this data came from.
*
* @param context The context used to access the settings resolver
* @return An 1-way hashed version of the {@link android.provider.Settings.Secure#ANDROID_ID}. May return null if an Android
* ID or the hashing algorithm is not available.
*/
public static String getAndroidIdHashOrNull(final Context context)
{
// Make sure a legacy version of the SDK didn't leave behind a device ID.
// If it did, this ID must be used to keep user counts accurate
final File fp = new File(context.getFilesDir() + LEGACY_DEVICE_ID_FILE);
if (fp.exists() && fp.length() > 0)
{
try
{
BufferedReader reader = null;
try
{
final char[] buf = new char[100];
int numRead;
reader = new BufferedReader(new FileReader(fp), 128);
numRead = reader.read(buf);
final String deviceId = String.copyValueOf(buf, 0, numRead);
reader.close();
return deviceId;
}
catch (final FileNotFoundException e)
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Caught exception", e); //$NON-NLS-1$
}
}
finally
{
if (null != reader)
{
reader.close();
}
}
}
catch (final IOException e)
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Caught exception", e); //$NON-NLS-1$
}
}
}
final String androidId = android.provider.Settings.Secure.getString(context.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
if (androidId == null || androidId.toLowerCase().equals(INVALID_ANDROID_ID))
{
return null;
}
return getSha256(androidId);
}
/**
* Gets a 1-way hashed value of the device's unique serial number. This value is encoded using a SHA-256 one way hash and
* therefore cannot be used to determine what device this data came from.
* <p>
* Note: {@link android.os.Build#SERIAL} was introduced in SDK 9. For older SDKs, this method will return null.
*
* @return An 1-way hashed version of the {@link android.os.Build#SERIAL}. May return null if a serial or the hashing
* algorithm is not available.
*/
/*
* Suppress JavaDoc warnings because the {@link android.os.Build#SERIAL} fails when built with SDK 4.
*/
public static String getSerialNumberHashOrNull()
{
/*
* Obtain the device serial number using reflection, since serial number was added in SDK 9
*/
String serialNumber = null;
if (Constants.CURRENT_API_LEVEL >= 9)
{
try
{
serialNumber = (String) Build.class.getField("SERIAL").get(null); //$NON-NLS-1$
}
catch (final Exception e)
{
/*
* This should never happen, as SERIAL is a public field added in SDK 9.
*/
throw new RuntimeException(e);
}
}
if (serialNumber == null)
{
return null;
}
return getSha256(serialNumber);
}
/**
* Gets the device's telephony ID (e.g. IMEI/MEID).
* <p>
* Note: this method will return null if {@link permission#READ_PHONE_STATE} is not available. This method will also return
* null on devices that do not have telephony.
*
* @param context The context used to access the phone state.
* @return An the {@link TelephonyManager#getDeviceId()}. Null if an ID is not available, or if
* {@link permission#READ_PHONE_STATE} is not available.
*/
public static String getTelephonyDeviceIdOrNull(final Context context)
{
if (Constants.CURRENT_API_LEVEL >= 8)
{
final Boolean hasTelephony = ReflectionUtils.tryInvokeInstance(context.getPackageManager(), "hasSystemFeature", new Class<?>[] { String.class }, new Object[] { "android.hardware.telephony" }); //$NON-NLS-1$//$NON-NLS-2$
if (!hasTelephony.booleanValue())
{
if (Constants.IS_LOGGABLE)
{
Log.i(Constants.LOG_TAG, "Device does not have telephony; cannot read telephony id"); //$NON-NLS-1$
}
return null;
}
}
/*
* Note: Sometimes Android will deny a package READ_PHONE_STATE permissions, even if the package has the permission. It
* appears to be a race condition that occurs during installation.
*/
String id = null;
if (context.getPackageManager().checkPermission(permission.READ_PHONE_STATE, context.getPackageName()) == PackageManager.PERMISSION_GRANTED)
{
final TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
id = manager.getDeviceId();
}
else
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Application does not have permission READ_PHONE_STATE; determining device id is not possible. Please consider requesting READ_PHONE_STATE in the AndroidManifest"); //$NON-NLS-1$
}
}
return id;
}
/**
* Gets a 1-way hashed value of the device's IMEI/MEID ID. This value is encoded using a SHA-256 one way hash and cannot be
* used to determine what device this data came from.
* <p>
* Note: this method will return null if this is a non-telephony device.
* <p>
* Note: this method will return null if {@link permission#READ_PHONE_STATE} is not available.
*
* @param context The context used to access the phone state.
* @return An 1-way hashed version of the {@link TelephonyManager#getDeviceId()}. Null if an ID or the hashing algorithm is
* not available, or if {@link permission#READ_PHONE_STATE} is not available.
*/
public static String getTelephonyDeviceIdHashOrNull(final Context context)
{
final String id = getTelephonyDeviceIdOrNull(context);
if (null == id)
{
return null;
}
return getSha256(id);
}
/**
* Determines the type of network this device is connected to.
*
* @param context the context used to access the device's WIFI
* @param telephonyManager The manager used to access telephony info
* @return The type of network, or unknown if the information is unavailable
*/
public static String getNetworkType(final Context context, final TelephonyManager telephonyManager)
{
if (context.getPackageManager().checkPermission(permission.ACCESS_WIFI_STATE, context.getPackageName()) == PackageManager.PERMISSION_GRANTED)
{
final NetworkInfo wifiInfo = ((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)).getNetworkInfo(ConnectivityManager.TYPE_WIFI);
if (wifiInfo != null && wifiInfo.isConnectedOrConnecting())
{
return "wifi"; //$NON-NLS-1$
}
}
else
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Application does not have permission ACCESS_WIFI_STATE; determining Wi-Fi connectivity is unavailable"); //$NON-NLS-1$
}
}
return "android_network_type_" + telephonyManager.getNetworkType(); //$NON-NLS-1$
}
/**
* Gets the device manufacturer's name. This is only available on SDK 4 or greater, so on SDK 3 this method returns the
* constant string "unknown".
*
* @return A string naming the manufacturer
*/
public static String getManufacturer()
{
String mfg = "unknown"; //$NON-NLS-1$
if (Constants.CURRENT_API_LEVEL > 3)
{
try
{
final Class<?> buildClass = Build.class;
mfg = (String) buildClass.getField("MANUFACTURER").get(null); //$NON-NLS-1$
}
catch (final Exception ignore)
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "Caught exception", ignore); //$NON-NLS-1$
}
}
}
return mfg;
}
/**
* Gets the versionName of the application.
*
* @param context {@link Context}. Cannot be null.
* @return The application's version
*/
public static String getAppVersion(final Context context)
{
final PackageManager pm = context.getPackageManager();
try
{
final String versionName = pm.getPackageInfo(context.getPackageName(), 0).versionName;
/*
* If there is no versionName in the Android Manifest, the versionName will be null.
*/
if (versionName == null)
{
if (Constants.IS_LOGGABLE)
{
Log.w(Constants.LOG_TAG, "versionName was null--is a versionName attribute set in the Android Manifest?"); //$NON-NLS-1$
}
return "unknown"; //$NON-NLS-1$
}
return versionName;
}
catch (final PackageManager.NameNotFoundException e)
{
/*
* This should never occur--our own package must exist for this code to be running
*/
throw new RuntimeException(e);
}
}
/**
* Helper method to generate a SHA-256 hash of a given String
*
* @param string String to hash. Cannot be null.
* @return hashed version of the string using SHA-256.
*/
/* package */static String getSha256(final String string)
{
if (Constants.ENABLE_PARAMETER_CHECKING)
{
if (null == string)
{
throw new IllegalArgumentException("string cannot be null"); //$NON-NLS-1$
}
}
try
{
final MessageDigest md = MessageDigest.getInstance("SHA-256"); //$NON-NLS-1$
final byte[] digest = md.digest(string.getBytes("UTF-8")); //$NON-NLS-1$
final BigInteger hashedNumber = new BigInteger(1, digest);
return hashedNumber.toString(16);
}
catch (final NoSuchAlgorithmException e)
{
throw new RuntimeException(e);
}
catch (final UnsupportedEncodingException e)
{
throw new RuntimeException(e);
}
}
}

@ -1,42 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.localytics.android;
import android.util.Log;
/**
* Exception handler for background threads used by the Localytics library.
* <p>
* Analytics are secondary to any other functions performed by an app, which means that analytics should never cause an app to
* crash. This handler therefore suppresses all uncaught exceptions from the Localytics library.
*/
/* package */final class ExceptionHandler implements Thread.UncaughtExceptionHandler
{
@Override
public void uncaughtException(final Thread thread, final Throwable throwable)
{
/*
* Wrap all the work done by the exception handler in a try-catch. It would be ironic if this exception handler itself
* caused the parent process to crash.
*/
try
{
if (Constants.IS_LOGGABLE)
{
Log.e(Constants.LOG_TAG, "Localytics library threw an uncaught exception", throwable); //$NON-NLS-1$
}
// TODO: Upload uncaught exceptions so that we can fix them
}
catch (final Exception e)
{
if (Constants.IS_LOGGABLE)
{
Log.e(Constants.LOG_TAG, "Exception handler threw an exception", e); //$NON-NLS-1$
}
}
}
}

@ -1,574 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.localytics.android;
import org.json.JSONArray;
import android.Manifest.permission;
/**
* Set of constants for building JSON objects that get sent to the Localytics web service.
*/
/* package */final class JsonObjects
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private JsonObjects()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Set of constants for the blob header JSON object.
*/
public static final class BlobHeader
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private BlobHeader()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "h"; //$NON-NLS-1$
/**
* Timestamp when the app was first launched and the persistent storage was created. Represented as seconds since the Unix
* Epoch. (Note: This is SECONDS and not milliseconds. This requires care, because Android represents time as
* milliseconds).
*/
public static final String KEY_PERSISTENT_STORAGE_CREATION_TIME_SECONDS = "pa"; //$NON-NLS-1$
/**
* Sequence number. A monotonically increasing count for each new blob.
*/
public static final String KEY_SEQUENCE_NUMBER = "seq"; //$NON-NLS-1$
/**
* A UUID for the blob.
*/
public static final String KEY_UNIQUE_ID = "u"; //$NON-NLS-1$
/**
* A JSON Object for attributes for the session.
*/
public static final String KEY_ATTRIBUTES = "attrs"; //$NON-NLS-1$
/**
* Attributes under {@link BlobHeader#KEY_ATTRIBUTES}
*/
public static final class Attributes
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private Attributes()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data connection type.
*/
public static final String KEY_DATA_CONNECTION = "dac"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Version name of the application, taken from the Android Manifest.
*/
public static final String KEY_CLIENT_APP_VERSION = "av"; //$NON-NLS-1$
/**
* Key which maps to the SHA-256 of the device's {@link android.provider.Settings.Secure#ANDROID_ID}.
*/
public static final String KEY_DEVICE_ANDROID_ID_HASH = "du"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
*/
public static final String KEY_DEVICE_COUNTRY = "dc"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Manufacturer of the device (e.g. HTC, Samsung, Motorola, Kyocera, etc.)
*/
public static final String KEY_DEVICE_MANUFACTURER = "dma"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Model of the device (e.g. dream,
*/
public static final String KEY_DEVICE_MODEL = "dmo"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Android version (e.g. 1.6 or 2.3.4).
*/
public static final String KEY_DEVICE_OS_VERSION = "dov"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Telephony ID of the device, if the device has telephony and the app has {@link permission#READ_PHONE_STATE}.
* Otherwise null.
*/
public static final String KEY_DEVICE_TELEPHONY_ID = "tdid"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Platform of the device. For Android devices, this is always "android"
*/
public static final String KEY_DEVICE_PLATFORM = "dp"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* SHA-256 hash of the device's serial number. Only reported for Android 2.3 or later. Otherwise null.
*/
public static final String KEY_DEVICE_SERIAL_HASH = "dms"; //$NON-NLS-1$
/**
* Type: {@code int}
* <p>
* SDK compatibility level of the device.
*
* @see android.os.Build.VERSION#SDK
*/
public static final String KEY_DEVICE_SDK_LEVEL = "dsdk"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* SHA-256 hash of the device's Telephony ID, if the device has telephony and the app has
* {@link permission#READ_PHONE_STATE}. Otherwise null.
*/
public static final String KEY_DEVICE_TELEPHONY_ID_HASH = "dtidh"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Country for the device's current locale settings
*/
public static final String KEY_LOCALE_COUNTRY = "dlc"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Language for the device's current locale settings
*/
public static final String KEY_LOCALE_LANGUAGE = "dll"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Api key
*/
public static final String KEY_LOCALYTICS_API_KEY = "au"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Localytics library version
*
* @see Constants#LOCALYTICS_CLIENT_LIBRARY_VERSION
*/
public static final String KEY_LOCALYTICS_CLIENT_LIBRARY_VERSION = "lv"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_LOCALYTICS_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Network carrier of the device
*/
public static final String KEY_NETWORK_CARRIER = "nca"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
*/
public static final String KEY_NETWORK_COUNTRY = "nc"; //$NON-NLS-1$
/**
* @see #KEY_LOCALYTICS_DATA_TYPE
*/
@SuppressWarnings("hiding")
public static final String VALUE_DATA_TYPE = "a"; //$NON-NLS-1$
/**
* Value for the platform.
*
* @see #KEY_DEVICE_PLATFORM
*/
public static final String VALUE_PLATFORM = "Android"; //$NON-NLS-1$
}
}
/**
* Set of constants for the session open event.
*/
/* package */static final class SessionOpen
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private SessionOpen()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "s"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Epoch timestamp when the session was started in seconds.
*/
public static final String KEY_WALL_TIME_SECONDS = "ct"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* UUID of the event, which is the same thing as the session UUID
*/
public static final String KEY_EVENT_UUID = "u"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Count for the number of sessions
*/
public static final String KEY_COUNT = "nth"; //$NON-NLS-1$
}
/**
* Set of constants for the session close event.
*/
/* package */static final class SessionClose
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private SessionClose()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* UUID of the event.
*/
public static final String KEY_EVENT_UUID = "u"; //$NON-NLS-1$
/**
* Type: {@code String[]} (technically, a JSON array of strings)
* <p>
* Ordered list of flow events that occurred
*/
public static final String KEY_FLOW_ARRAY = "fl"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Epoch timestamp when the session was started
*/
public static final String KEY_SESSION_LENGTH_SECONDS = "ctl"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Start time of the parent session
*/
public static final String KEY_SESSION_START_TIME = "ss"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* UUID of the session.
*/
public static final String KEY_SESSION_UUID = "su"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Epoch timestamp when the session was started in seconds.
*/
public static final String KEY_WALL_TIME_SECONDS = "ct"; //$NON-NLS-1$
/**
* Data type for close events.
*
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "c"; //$NON-NLS-1$
}
/**
* Set of constants for the session event event.
*/
/* package */static final class SessionEvent
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private SessionEvent()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* Data type for application events.
*
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "e"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Epoch timestamp when the session was started in seconds.
*/
public static final String KEY_WALL_TIME_SECONDS = "ct"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* UUID of the session.
*/
public static final String KEY_SESSION_UUID = "su"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* UUID of the event.
*/
public static final String KEY_EVENT_UUID = "u"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* Name of the event.
*/
public static final String KEY_NAME = "n"; //$NON-NLS-1$
/**
* Type: {@code JSONObject}.
* <p>
* Maps to the attributes of the event.
* <p>
* Note that this key is optional. If it is present, it will point to a non-null value representing the attributes of the
* event. Otherwise the key will not exist, indicating the event had no attributes.
*/
public static final String KEY_ATTRIBUTES = "attrs"; //$NON-NLS-1$
}
/**
* Set of constants for the session opt in/out event
*/
/* package */static final class OptEvent
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private OptEvent()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* Data type for opt in/out events.
*
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "o"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Epoch timestamp when the session was started in seconds.
*/
public static final String KEY_WALL_TIME_SECONDS = "ct"; //$NON-NLS-1$
/**
* Type: {@code String}
* <p>
* API key
*/
public static final String KEY_API_KEY = "u"; //$NON-NLS-1$
/**
* Type: {@code boolean}
* <p>
* True to opt-out. False to opt-in
*/
public static final String KEY_OPT = "out"; //$NON-NLS-1$
}
/**
* Set of constants for the session flow event.
*/
/* package */static final class EventFlow
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private EventFlow()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Type: {@code String}
* <p>
* Data type for the JSON object.
*
* @see #VALUE_DATA_TYPE
*/
public static final String KEY_DATA_TYPE = "dt"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* UUID of the event, which is the same thing as the session UUID
*/
public static final String KEY_EVENT_UUID = "u"; //$NON-NLS-1$
/**
* Type: {@code long}
* <p>
* Start time of the parents session.
*/
public static final String KEY_SESSION_START_TIME = "ss"; //$NON-NLS-1$
/**
* Type: {@code Element[]} (technically a {@link JSONArray} of {@link Element} objects)
* <p>
* Ordered set of new flow elements that occurred since the last upload for this session.
*/
public static final String KEY_FLOW_NEW = "nw"; //$NON-NLS-1$
/**
* Type: {@code Element[]} (technically a {@link JSONArray} of {@link Element} objects)
* <p>
* Ordered set of old flow elements that occurred during all previous uploads for this session.
*/
public static final String KEY_FLOW_OLD = "od"; //$NON-NLS-1$
/**
* @see #KEY_DATA_TYPE
*/
public static final String VALUE_DATA_TYPE = "f"; //$NON-NLS-1$
/**
* Flow event element that indicates the type and name of the flow event.
*/
/* package */static final class Element
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private Element()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* A flow event that was due to an {@link SessionEvent}.
*/
public static final String TYPE_EVENT = "e"; //$NON-NLS-1$
/**
* A flow event that was due to a screen event.
*/
public static final String TYPE_SCREEN = "s"; //$NON-NLS-1$
}
}
}

@ -1,114 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.localytics.android;
import java.lang.reflect.InvocationTargetException;
/**
* Static utilities for performing reflection against newer Android SDKs.
* <p>
* This is not a general-purpose reflection class but is rather specifically designed for calling methods that must exist in newer
* versions of Android.
*/
public final class ReflectionUtils
{
/**
* Private constructor prevents instantiation
*
* @throws UnsupportedOperationException because this class cannot be instantiated.
*/
private ReflectionUtils()
{
throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$
}
/**
* Use reflection to invoke a static method for a class object and method name
*
* @param <T> Type that the method should return
* @param classObject Class on which to invoke {@code methodName}. Cannot be null.
* @param methodName Name of the method to invoke. Cannot be null.
* @param types explicit types for the objects. This is useful if the types are primitives, rather than objects.
* @param args arguments for the method. May be null if the method takes no arguments.
* @return The result of invoking the named method on the given class for the args
* @throws RuntimeException if the class or method doesn't exist
*/
public static <T> T tryInvokeStatic(final Class<?> classObject, final String methodName, final Class<?>[] types, final Object[] args)
{
return (T) helper(null, classObject, null, methodName, types, args);
}
/**
* Use reflection to invoke a static method for a class object and method name
*
* @param <T> Type that the method should return
* @param className Name of the class on which to invoke {@code methodName}. Cannot be null.
* @param methodName Name of the method to invoke. Cannot be null.
* @param types explicit types for the objects. This is useful if the types are primitives, rather than objects.
* @param args arguments for the method. May be null if the method takes no arguments.
* @return The result of invoking the named method on the given class for the args
* @throws RuntimeException if the class or method doesn't exist
*/
public static <T> T tryInvokeStatic(final String className, final String methodName, final Class<?>[] types, final Object[] args)
{
return (T) helper(className, null, null, methodName, types, args);
}
/**
* Use reflection to invoke a static method for a class object and method name
*
* @param <T> Type that the method should return
* @param target Object instance on which to invoke {@code methodName}. Cannot be null.
* @param methodName Name of the method to invoke. Cannot be null.
* @param types explicit types for the objects. This is useful if the types are primitives, rather than objects.
* @param args arguments for the method. May be null if the method takes no arguments.
* @return The result of invoking the named method on the given class for the args
* @throws RuntimeException if the class or method doesn't exist
*/
public static <T> T tryInvokeInstance(final Object target, final String methodName, final Class<?>[] types, final Object[] args)
{
return (T) helper(target, null, null, methodName, types, args);
}
@SuppressWarnings("unchecked")
private static <T> T helper(final Object target, final Class<?> classObject, final String className, final String methodName, final Class<?>[] argTypes, final Object[] args)
{
try
{
Class<?> cls;
if (classObject != null)
{
cls = classObject;
}
else if (target != null)
{
cls = target.getClass();
}
else
{
cls = Class.forName(className);
}
return (T) cls.getMethod(methodName, argTypes).invoke(target, args);
}
catch (final NoSuchMethodException e)
{
throw new RuntimeException(e);
}
catch (final IllegalAccessException e)
{
throw new RuntimeException(e);
}
catch (final InvocationTargetException e)
{
throw new RuntimeException(e);
}
catch (final ClassNotFoundException e)
{
throw new RuntimeException(e);
}
}
}

@ -9,7 +9,6 @@ import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
import com.todoroo.astrid.actfm.sync.ActFmSyncV2Provider;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.sync.SyncProviderUtilities;
import com.todoroo.astrid.sync.SyncV2BackgroundService;
import com.todoroo.astrid.sync.SyncV2Provider;
@ -43,12 +42,10 @@ public class ActFmBackgroundService extends SyncV2BackgroundService {
@Override
public void onCreate() {
super.onCreate();
StatisticsService.sessionStart(this);
}
@Override
public void onDestroy() {
StatisticsService.sessionStop(this);
super.onDestroy();
}

@ -30,7 +30,6 @@ import com.google.api.client.googleapis.extensions.android2.auth.GoogleAccountMa
import com.timsu.astrid.R;
import com.todoroo.andlib.service.ContextManager;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.service.StatisticsService;
/**
* This activity allows users to sign in or log in to Google Tasks
@ -163,19 +162,16 @@ public class ActFmGoogleAuthActivity extends ListActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
}
@Override
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
private static final int REQUEST_AUTHENTICATE = 0;

@ -106,7 +106,6 @@ import com.todoroo.astrid.helper.UUIDHelper;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.SyncV2Service;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.subtasks.AstridOrderedListUpdater;
@ -232,14 +231,12 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
protected void onResume() {
super.onResume();
uiHelper.onResume();
StatisticsService.sessionStart(this);
}
@Override
protected void onPause() {
super.onPause();
uiHelper.onPause();
StatisticsService.sessionPause();
}
@Override
@ -250,12 +247,10 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
@Override
protected void onStop() {
StatisticsService.sessionStop(this);
super.onStop();
}
protected void recordPageView() {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_SHOW);
}
protected void setupTermsOfService(TextView tos) {
@ -331,7 +326,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
Intent intent = new Intent(ActFmLoginActivity.this,
ActFmGoogleAuthActivity.class);
startActivityForResult(intent, REQUEST_CODE_GOOGLE);
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_GL_START);
}
};
@ -395,7 +389,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
AndroidUtilities.hideSoftInputForViews(ActFmLoginActivity.this, firstNameField, lastNameField, email);
authenticate(email.getText().toString(),
firstName, lastName, ActFmInvoker.PROVIDER_PASSWORD, generateRandomPassword());
StatisticsService.reportEvent(StatisticsConstants.ACTFM_SIGNUP_PW);
}
}).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
@ -462,7 +455,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
authenticate(email.getText().toString(),
"", "", ActFmInvoker.PROVIDER_PASSWORD, //$NON-NLS-1$//$NON-NLS-2$
password.getText().toString());
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_PW);
}
}).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
@Override
@ -594,7 +586,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
final String token = actFmInvoker.getToken();
if (result.optBoolean("new")) { // Report new user statistic
StatisticsService.reportEvent(StatisticsConstants.ACTFM_NEW_USER, "provider", provider);
}
// Successful login, create outstanding entries
String lastId = ActFmPreferenceService.userId(); //Preferences.getLong(ActFmPreferenceService.PREF_USER_ID, 0);

@ -29,7 +29,6 @@ import com.todoroo.astrid.billing.BillingActivity;
import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.service.PremiumUnlockService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.sync.SyncProviderPreferences;
import com.todoroo.astrid.sync.SyncProviderUtilities;
import com.todoroo.astrid.utility.Constants;
@ -208,7 +207,6 @@ public class ActFmPreferences extends SyncProviderPreferences {
} else {
Intent intent = new Intent(this, BillingActivity.class);
startActivity(intent);
StatisticsService.reportEvent(StatisticsConstants.PREMIUM_PAGE_VIEWED);
}
}

@ -56,7 +56,6 @@ import com.todoroo.astrid.dao.UserActivityDao;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.UserActivity;
import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.StatisticsService;
import edu.mit.mobile.android.imagecache.ImageCache;
@ -408,8 +407,6 @@ public abstract class CommentsFragment extends SherlockListFragment {
resetPictureButton();
refreshUpdatesList();
StatisticsService.reportEvent(commentAddStatistic());
}
@Override

@ -62,7 +62,6 @@ import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.ThemeService;
@ -714,9 +713,7 @@ public class EditPeopleControlSet extends PopupControlSet {
task.putTransitory(TaskService.TRANS_ASSIGNED, true);
if (assignedView == assignedCustom) {
StatisticsService.reportEvent(StatisticsConstants.TASK_ASSIGNED_EMAIL);
} else if (task.getValue(Task.USER_ID) != Task.USER_ID_SELF) {
StatisticsService.reportEvent(StatisticsConstants.TASK_ASSIGNED_PICKER);
}
return true;

@ -60,7 +60,6 @@ import com.todoroo.astrid.data.User;
import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.helper.UUIDHelper;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.tags.TagFilterExposer;
@ -376,7 +375,6 @@ public class TagSettingsActivity extends SherlockFragmentActivity {
int oldMemberCount = tagData.getValue(TagData.MEMBER_COUNT);
if (members.length() > oldMemberCount) {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LIST_SHARED);
}
tagData.setValue(TagData.MEMBER_COUNT, members.length());
tagData.setFlag(TagData.FLAGS, TagData.FLAG_SILENT, isSilent.isChecked());

@ -17,7 +17,6 @@ import com.todoroo.astrid.dao.RemoteModelDao;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.service.PremiumUnlockService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.sync.SyncProviderUtilities;
import com.todoroo.astrid.utility.AstridPreferences;
@ -121,7 +120,6 @@ public class ActFmPreferenceService extends SyncProviderUtilities {
@Override
protected void reportLastErrorImpl(String lastError, String type) {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_SYNC_ERROR, "type", type); //$NON-NLS-1$
}
public synchronized static JSONObject thisUser() {

@ -25,7 +25,6 @@ import android.net.NetworkInfo;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import com.crittercism.app.Crittercism;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.service.Autowired;
@ -381,7 +380,6 @@ public class ActFmSyncThread {
} catch (Exception e) {
// In the worst case, restart thread if something goes wrong
Log.e(ERROR_TAG, "Unexpected sync thread exception", e);
Crittercism.logHandledException(e);
thread = null;
startSyncThread();
}

@ -6,7 +6,6 @@ import java.util.Set;
import android.text.TextUtils;
import android.util.Log;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.DatabaseDao;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.TodorooCursor;
@ -109,12 +108,10 @@ public class AstridNewSyncMigrator {
tagDataService.save(newTagData);
} catch (Exception e) {
Log.e(LOG_TAG, "Error creating tag data", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error creating tag data", e);
Crittercism.logHandledException(e);
} finally {
if (noTagData != null) {
noTagData.close();
@ -139,11 +136,9 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error clearing emergent tags");
Crittercism.logHandledException(e);
}
}
} catch (Exception e){
Crittercism.logHandledException(e);
} finally {
if (emergentTags != null) {
emergentTags.close();
@ -192,7 +187,6 @@ public class AstridNewSyncMigrator {
});
} catch (Exception e) {
Log.e(LOG_TAG, "Error asserting UUIDs", e);
Crittercism.logHandledException(e);
}
// --------------
@ -207,7 +201,6 @@ public class AstridNewSyncMigrator {
taskDao.update(Functions.bitwiseAnd(Task.FLAGS, Task.FLAG_PUBLIC).gt(0), template);
} catch (Exception e) {
Log.e(LOG_TAG, "Error clearing task flags", e);
Crittercism.logHandledException(e);
}
// --------------
@ -239,12 +232,10 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating recurrence", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating recurrence", e);
Crittercism.logHandledException(e);
} finally {
if (tasksWithRecurrence != null) {
tasksWithRecurrence.close();
@ -291,13 +282,11 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating updates", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating updates", e);
Crittercism.logHandledException(e);
} finally {
if (updates != null) {
updates.close();
@ -313,7 +302,6 @@ public class AstridNewSyncMigrator {
userDao.deleteWhere(Criterion.or(User.UUID.isNull(), User.UUID.eq(""), User.UUID.eq("0")));
} catch (Exception e) {
Log.e(LOG_TAG, "Error deleting incomplete user entries", e);
Crittercism.logHandledException(e);
}
// --------------
@ -369,13 +357,11 @@ public class AstridNewSyncMigrator {
taskAttachmentDao.createNew(attachment);
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating task attachment metadata", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating task attachment metadata", e);
Crittercism.logHandledException(e);
} finally {
if (fmCursor != null) {
fmCursor.close();
@ -401,7 +387,6 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating active tasks ordering", e);
Crittercism.logHandledException(e);
}
try {
@ -420,7 +405,6 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating today ordering", e);
Crittercism.logHandledException(e);
}
TodorooCursor<TagData> allTagData = null;
@ -441,12 +425,10 @@ public class AstridNewSyncMigrator {
taskListMetadataDao.createNew(tlm);
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating tag ordering", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating tag ordering", e);
Crittercism.logHandledException(e);
} finally {
if (allTagData != null) {
allTagData.close();
@ -493,13 +475,11 @@ public class AstridNewSyncMigrator {
} catch (Exception e) {
Log.e(LOG_TAG, "Error validating task to tag metadata", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error validating task to tag metadata", e);
Crittercism.logHandledException(e);
} finally {
if (incompleteMetadata != null) {
incompleteMetadata.close();
@ -513,7 +493,6 @@ public class AstridNewSyncMigrator {
tagDataDao.deleteWhere(Functions.bitwiseAnd(TagData.FLAGS, TagData.FLAG_FEATURED).gt(0));
} catch (Exception e) {
Log.e(LOG_TAG, "Error deleting featured list data", e);
Crittercism.logHandledException(e);
}
@ -549,12 +528,10 @@ public class AstridNewSyncMigrator {
taskOutstandingDao.createNew(to);
} catch (Exception e) {
Log.e(LOG_TAG, "Error creating tag_added outstanding entries", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error creating tag_added outstanding entries", e);
Crittercism.logHandledException(e);
} finally {
if (tagsAdded != null) {
tagsAdded.close();
@ -602,12 +579,10 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error asserting UUIDs", e);
Crittercism.logHandledException(e);
}
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error asserting UUIDs", e);
Crittercism.logHandledException(e);
} finally {
if (cursor != null) {
cursor.close();

@ -14,7 +14,6 @@ import org.json.JSONObject;
import android.text.TextUtils;
import android.util.Log;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.Property.PropertyVisitor;
import com.todoroo.andlib.data.TodorooCursor;
@ -186,7 +185,6 @@ public class ChangesHappened<TYPE extends RemoteModel, OE extends OutstandingEnt
array.put(changeJson);
} catch (JSONException e) {
Log.e(ERROR_TAG, "Error writing change to JSON", e);
Crittercism.logHandledException(e);
}
}
return array;

@ -4,7 +4,6 @@ import org.apache.http.entity.mime.MultipartEntity;
import org.json.JSONException;
import org.json.JSONObject;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.utility.DateUtilities;
@ -80,7 +79,6 @@ public abstract class ClientToServerMessage<TYPE extends RemoteModel> {
return null;
}
} catch (JSONException e) {
Crittercism.logHandledException(e);
return null;
}
}

@ -8,7 +8,6 @@ package com.todoroo.astrid.backup;
import java.io.File;
import android.os.Environment;
import edu.umd.cs.findbugs.annotations.CheckForNull;
/**
@ -68,7 +67,6 @@ public class BackupConstants {
/**
* @return export directory for tasks, or null if no SD card
*/
@CheckForNull
public static File defaultExportDirectory() {
String storageState = Environment.getExternalStorageState();
if (storageState.equals(Environment.MEDIA_MOUNTED)) {

@ -56,7 +56,6 @@ import com.todoroo.astrid.api.TextInputCriterion;
import com.todoroo.astrid.dao.Database;
import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.utility.AstridPreferences;
@ -277,21 +276,18 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
@Override
protected void onStop() {
StatisticsService.sessionStop(this);
super.onStop();
}
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
registerReceiver(filterCriteriaReceiver, new IntentFilter(AstridApiConstants.BROADCAST_SEND_CUSTOM_FILTER_CRITERIA));
populateCriteria();
}
@Override
protected void onPause() {
StatisticsService.sessionPause();
super.onPause();
unregisterReceiver(filterCriteriaReceiver);
}

@ -35,7 +35,6 @@ import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gcal.Calendars.CalendarResult;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.ui.PopupControlSet;
@ -149,7 +148,6 @@ public class GCalControlSet extends PopupControlSet {
!Preferences.getStringValue(R.string.gcal_p_default).equals("-1");
if ((gcalCreateEventEnabled || calendarSelector.getSelectedItemPosition() != 0) &&
calendarUri == null) {
StatisticsService.reportEvent(StatisticsConstants.CREATE_CALENDAR_EVENT);
try{
ContentResolver cr = activity.getContentResolver();

@ -8,7 +8,6 @@ package com.todoroo.astrid.gtasks;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.gtasks.sync.GtasksSyncV2Provider;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.sync.SyncProviderUtilities;
import com.todoroo.astrid.sync.SyncV2BackgroundService;
import com.todoroo.astrid.sync.SyncV2Provider;
@ -33,12 +32,10 @@ public class GtasksBackgroundService extends SyncV2BackgroundService {
@Override
public void onCreate() {
super.onCreate();
StatisticsService.sessionStart(this);
}
@Override
public void onDestroy() {
StatisticsService.sessionStop(this);
super.onDestroy();
}

@ -8,7 +8,6 @@ package com.todoroo.astrid.gtasks;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.sync.SyncProviderUtilities;
/**
@ -58,7 +57,6 @@ public class GtasksPreferenceService extends SyncProviderUtilities {
@Override
protected void reportLastErrorImpl(String lastError, String type) {
StatisticsService.reportEvent(StatisticsConstants.GTASKS_SYNC_ERROR, "type", type); //$NON-NLS-1$
}
}

@ -36,7 +36,6 @@ import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.gtasks.GtasksPreferenceService;
import com.todoroo.astrid.gtasks.api.GtasksInvoker;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.SyncV2Service;
/**
@ -169,19 +168,16 @@ public class GtasksLoginActivity extends ListActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
}
@Override
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
private static final int REQUEST_AUTHENTICATE = 0;

@ -55,7 +55,6 @@ import com.todoroo.astrid.gtasks.auth.GtasksTokenValidator;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.SyncResultCallbackWrapper.WidgetUpdatingCallbackWrapper;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.sync.SyncResultCallback;
@ -377,7 +376,6 @@ public class GtasksSyncV2Provider extends SyncV2Provider {
} else {
mergeDates(task.task, local);
if(task.task.isCompleted() && !local.isCompleted()) {
StatisticsService.reportEvent(StatisticsConstants.GTASKS_TASK_COMPLETED);
}
}
} else { // Set default importance and reminders for remotely created tasks

@ -28,7 +28,6 @@ import com.todoroo.astrid.api.FilterCategory;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.twofortyfouram.SharedResources;
/**
@ -200,9 +199,6 @@ public final class LocaleEditAlerts extends ListActivity {
.setPositiveButton(android.R.string.ok,
AddOnActivity.createAddOnClicker(LocaleEditAlerts.this, true))
.show();
StatisticsService.reportEvent(StatisticsConstants.LOCALE_EDIT_ALERTS_NO_PLUGIN);
} else {
StatisticsService.reportEvent(StatisticsConstants.LOCALE_EDIT_ALERTS);
}
}
@ -281,14 +277,12 @@ public final class LocaleEditAlerts extends ListActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
adapter.registerRecevier();
}
@Override
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
adapter.unregisterRecevier();
}
@ -300,7 +294,6 @@ public final class LocaleEditAlerts extends ListActivity {
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
/**

@ -79,7 +79,6 @@ import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.timers.TimerActionControlSet.TimerActionListener;
import com.todoroo.astrid.utility.ResourceDrawableCache;
@ -546,7 +545,6 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
if (pictureButton != null) {
pictureButton.setImageResource(cameraButton);
}
StatisticsService.reportEvent(StatisticsConstants.ACTFM_TASK_COMMENT);
setUpListAdapter();
for (UpdatesChangedListener l : listeners) {

@ -30,7 +30,6 @@ import com.todoroo.astrid.activity.TaskListFragment;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.repeats.RepeatControlSet;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.ui.NumberPicker;
/**
@ -62,7 +61,6 @@ public class NotificationFragment extends TaskListFragment {
@Override
protected void onTaskCompleted(Task item) {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_NOTIFICATION);
}
@Override

@ -49,7 +49,6 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.User;
import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.tags.TagMemberMetadata;
import com.todoroo.astrid.tags.TagService;
@ -86,7 +85,6 @@ public class ReminderDialog extends Dialog {
task.setValue(Task.REMINDER_SNOOZE, time);
PluginServices.getTaskService().save(task);
dismiss();
StatisticsService.reportEvent(StatisticsConstants.TASK_SNOOZE);
}
};
final OnTimeSetListener onTimeSet = new OnTimeSetListener() {

@ -58,7 +58,6 @@ public class ReminderPreferences extends TodorooPreferenceActivity {
int index = AndroidUtilities.indexOf(r.getStringArray(R.array.EPr_rmd_time_values), (String)value);
if (index != -1 && index < r.getStringArray(R.array.EPr_rmd_time).length) {
// FIXME this does not fix the underlying cause of the ArrayIndexOutofBoundsException
// https://www.crittercism.com/developers/crash-details/e0886dbfcf9e78a21d9f2e2a385c4c13e2f6ad2132ac24a3fa811144
String setting = r.getStringArray(R.array.EPr_rmd_time)[index];
preference.setSummary(r.getString(R.string.rmd_EPr_rmd_time_desc, setting));
}

@ -39,7 +39,6 @@ import com.todoroo.andlib.service.ExceptionService;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.ui.DateAndTimeDialog;
@ -341,7 +340,6 @@ public class RepeatControlSet extends PopupControlSet {
result = ""; //$NON-NLS-1$
} else {
if(TextUtils.isEmpty(task.getValue(Task.RECURRENCE))) {
StatisticsService.reportEvent(StatisticsConstants.REPEAT_TASK_CREATE);
}
RRule rrule = new RRule();

@ -36,7 +36,6 @@ import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.gcal.GCalHelper;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.utility.Flags;
@ -73,9 +72,6 @@ public class RepeatTaskCompleteListener extends BroadcastReceiver {
return;
}
StatisticsService.reportEvent(StatisticsConstants.V2_TASK_REPEAT);
long oldDueDate = task.getValue(Task.DUE_DATE);
long repeatUntil = task.getValue(Task.REPEAT_UNTIL);

@ -29,7 +29,6 @@ import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.tags.TagFilterExposer;
import com.todoroo.astrid.tags.TagService.Tag;
@ -130,7 +129,6 @@ public class FeaturedTaskListFragment extends TagViewFragment {
return;
}
StatisticsService.reportEvent(StatisticsConstants.FEATURED_LIST_CLONED);
final String localName = tagData.getValue(TagData.NAME) + " " + getString(R.string.actfm_feat_list_suffix); //$NON-NLS-1$
TagData clone = new TagData();
TodorooCursor<TagData> existing = tagDataService.query(Query.select(TagData.PROPERTIES)

@ -25,7 +25,6 @@ import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.core.PluginServices;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.utility.Constants;
public class TimerPlugin extends BroadcastReceiver {
@ -62,7 +61,6 @@ public class TimerPlugin extends BroadcastReceiver {
if(start) {
if(task.getValue(Task.TIMER_START) == 0) {
task.setValue(Task.TIMER_START, DateUtilities.now());
StatisticsService.reportEvent(StatisticsConstants.TIMER_START);
}
} else {
if(task.getValue(Task.TIMER_START) > 0) {
@ -70,7 +68,6 @@ public class TimerPlugin extends BroadcastReceiver {
task.setValue(Task.TIMER_START, 0L);
task.setValue(Task.ELAPSED_SECONDS,
task.getValue(Task.ELAPSED_SECONDS) + newElapsed);
StatisticsService.reportEvent(StatisticsConstants.TIMER_STOP);
}
}
PluginServices.getTaskService().save(task);

@ -41,12 +41,6 @@
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.crittercism.*
-keepclassmembers public class com.crittercism.* {
*;
}
-keep class com.facebook.** {
*;
}

@ -412,11 +412,6 @@
<string name="actfm_APr_interval_key">actfm_sync_freq</string>
<!-- ======================================================== POWERPACK == -->
<!-- Anonymous usage statistics -->
<string name="p_statistics">statistics</string>
<!-- ================================================= NEW USER EXPERIENCE -->
<!-- Preference Keys (do not translate) -->
<string name="p_showed_add_task_help">showed_add_task_help</string>

@ -24,11 +24,5 @@
<CheckBoxPreference
android:title="@string/EPr_cal_end_or_start_at_due_time"
android:key = "@string/p_end_at_deadline" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_statistics"
android:title="@string/EPr_statistics_title"
android:defaultValue="true" />
</PreferenceScreen>
</PreferenceScreen>

@ -44,7 +44,6 @@ import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.subtasks.SubtasksHelper;
import com.todoroo.astrid.ui.DateChangedAlerts;
import com.todoroo.astrid.ui.QuickAddBar;
@ -113,7 +112,6 @@ public class AstridActivity extends SherlockFragmentActivity
DependencyInjectionService.getInstance().inject(this);
super.onCreate(savedInstanceState);
ContextManager.setContext(this);
StatisticsService.sessionStart(this);
new StartupService().onStartupApplication(this);
}
@ -132,14 +130,12 @@ public class AstridActivity extends SherlockFragmentActivity
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
AndroidUtilities.tryUnregisterReceiver(this, repeatConfirmationReceiver);
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
/**
@ -152,7 +148,6 @@ public class AstridActivity extends SherlockFragmentActivity
}
if (item instanceof SearchFilter) {
onSearchRequested();
StatisticsService.reportEvent(StatisticsConstants.FILTER_SEARCH);
return false;
} else {
// If showing both fragments, directly update the tasklist-fragment
@ -169,7 +164,6 @@ public class AstridActivity extends SherlockFragmentActivity
// no animation for dualpane-layout
AndroidUtilities.callOverridePendingTransition(this, 0, 0);
StatisticsService.reportEvent(StatisticsConstants.FILTER_LIST);
return true;
} else if(item instanceof IntentFilter) {
try {

@ -31,7 +31,6 @@ import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.widget.Toast;
import com.crittercism.app.Crittercism;
import com.timsu.astrid.R;
import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.ContextManager;
@ -56,7 +55,6 @@ import com.todoroo.astrid.service.AddOnService;
import com.todoroo.astrid.service.MarketStrategy.AmazonMarketStrategy;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.sync.SyncProviderPreferences;
import com.todoroo.astrid.ui.ContactListAdapter;
@ -136,7 +134,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Override
public void onClick(DialogInterface dialog, int which) {
spec.resetDefaults();
StatisticsService.reportEvent(statistic);
setResult(RESULT_CODE_PERFORMANCE_PREF_CHANGED);
finish();
}
@ -288,7 +285,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
boolean hasPowerPack = addOnService.hasPowerPack();
findPreference(getString(R.string.p_files_dir)).setEnabled(ActFmPreferenceService.isPremiumUser());
findPreference(getString(R.string.p_voiceRemindersEnabled)).setEnabled(hasPowerPack);
findPreference(getString(R.string.p_statistics)).setEnabled(hasPowerPack);
}
/** Show about dialog */
@ -517,8 +513,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Override
public boolean onPreferenceChange(Preference p, Object newValue) {
String valueString = newValue.toString();
StatisticsService.reportEvent(StatisticsConstants.PREF_CHANGED_PREFIX + "row-style", //$NON-NLS-1$
"changed-to", valueString); //$NON-NLS-1$
Preference notes = findPreference(getString(R.string.p_showNotes));
Preference fullTitle = findPreference(getString(R.string.p_fullTaskTitle));
try {
@ -588,10 +582,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
dir = r.getString(R.string.p_files_dir_desc_default);
}
preference.setSummary(r.getString(R.string.p_files_dir_desc, dir));
}
else if (booleanPreference(preference, value, R.string.p_statistics,
R.string.EPr_statistics_desc_disabled, R.string.EPr_statistics_desc_enabled)) {
;
} else if (booleanPreference(preference, value, R.string.p_field_missed_calls,
R.string.MCA_missed_calls_pref_desc_disabled, R.string.MCA_missed_calls_pref_desc_enabled)) {
;
@ -718,28 +708,10 @@ public class EditPreferences extends TodorooPreferenceActivity {
});
}
findPreference(getString(R.string.p_statistics)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
Boolean value = (Boolean) newValue;
try {
if (!value.booleanValue()) {
Crittercism.setOptOutStatus(true);
} else {
Crittercism.setOptOutStatus(false);
}
} catch (NullPointerException e) {
return false;
}
return true;
}
});
findPreference(getString(R.string.p_showNotes)).setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
updatePreferences(preference, newValue);
StatisticsService.reportEvent(StatisticsConstants.PREF_SHOW_NOTES_IN_ROW, "enabled", newValue.toString()); //$NON-NLS-1$
return true;
}
});
@ -748,7 +720,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
updatePreferences(preference, newValue);
StatisticsService.reportEvent(StatisticsConstants.PREF_CHANGED_PREFIX + "full-title", "full-title", newValue.toString()); //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
});
@ -817,7 +788,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Override
protected void onPause() {
StatisticsService.sessionPause();
super.onPause();
}
@ -829,12 +799,10 @@ public class EditPreferences extends TodorooPreferenceActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
}
@Override
protected void onStop() {
StatisticsService.sessionStop(this);
super.onStop();
}

@ -26,7 +26,6 @@ import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
/**
@ -110,7 +109,6 @@ public final class Eula {
((EulaCallback)activity).eulaAccepted();
}
Preferences.setBoolean(PREFERENCE_EULA_ACCEPTED, true);
StatisticsService.reportEvent(StatisticsConstants.EULA_ACCEPTED);
}
private static void refuse(Activity activity) {

@ -52,7 +52,6 @@ import com.todoroo.astrid.api.AstridApiConstants;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.api.FilterWithUpdate;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.tags.TagsPlugin;
import com.todoroo.astrid.utility.AstridPreferences;
@ -186,14 +185,12 @@ public class FilterListFragment extends SherlockListFragment {
@Override
public void onStop() {
StatisticsService.sessionStop(getActivity());
super.onStop();
}
@Override
public void onResume() {
super.onResume();
StatisticsService.sessionStart(getActivity());
if(adapter != null) {
adapter.registerRecevier();
}
@ -215,7 +212,6 @@ public class FilterListFragment extends SherlockListFragment {
@Override
public void onPause() {
StatisticsService.sessionPause();
super.onPause();
if(adapter != null) {
adapter.unregisterRecevier();

@ -17,7 +17,6 @@ import com.timsu.astrid.R;
import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.adapter.FilterAdapter;
import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
@SuppressWarnings("nls")
@ -79,14 +78,12 @@ public class FilterShortcutActivity extends ListActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
adapter.registerRecevier();
}
@Override
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
adapter.unregisterRecevier();
}
@ -98,7 +95,6 @@ public class FilterShortcutActivity extends ListActivity {
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
}

@ -16,7 +16,6 @@ import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import com.timsu.astrid.R;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
public class ShareActivity extends SherlockFragmentActivity {
@ -45,7 +44,6 @@ public class ShareActivity extends SherlockFragmentActivity {
setUpTextView(google, getString(R.string.share_with_google), "https://plus.google.com/116404018347675245869", "google"); //$NON-NLS-1$ //$NON-NLS-2$
setupText();
StatisticsService.reportEvent(StatisticsConstants.SHARE_PAGE_VIEWED);
}
private void setUpTextView(TextView tv, String text, final String url, final String buttonId) {
@ -53,7 +51,6 @@ public class ShareActivity extends SherlockFragmentActivity {
((View) tv.getParent()).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
StatisticsService.reportEvent(StatisticsConstants.SHARE_BUTTON_CLICKED, "button", buttonId); //$NON-NLS-1$
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
}

@ -93,7 +93,6 @@ import com.todoroo.astrid.opencrx.OpencrxCoreUtils;
import com.todoroo.astrid.reminders.Notifications;
import com.todoroo.astrid.repeats.RepeatControlSet;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.tags.TagsControlSet;
@ -786,12 +785,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
}
if (model.getValue(Task.TITLE).length() == 0) {
StatisticsService.reportEvent(StatisticsConstants.CREATE_TASK);
// set deletion date until task gets a title
model.setValue(Task.DELETION_DATE, DateUtilities.now());
} else {
StatisticsService.reportEvent(StatisticsConstants.EDIT_TASK);
}
setIsNewTask(model.getValue(Task.TITLE).length() == 0);
@ -1340,7 +1336,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
@Override
public void onPause() {
super.onPause();
StatisticsService.sessionPause();
if (shouldSaveState) {
save(true);
@ -1350,7 +1345,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
@Override
public void onResume() {
super.onResume();
StatisticsService.sessionStart(getActivity());
populateFields();
}
@ -1414,7 +1408,6 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener {
@Override
public void onStop() {
super.onStop();
StatisticsService.sessionStop(getActivity());
}
private void adjustInfoPopovers() {

@ -59,7 +59,6 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.people.PeopleFilterMode;
import com.todoroo.astrid.people.PersonViewFragment;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
import com.todoroo.astrid.service.abtesting.ABTestEventReportingService;
import com.todoroo.astrid.tags.TagFilterExposer;
@ -860,22 +859,16 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener
switch (getIntent().getIntExtra(TOKEN_SOURCE,
Constants.SOURCE_DEFAULT)) {
case Constants.SOURCE_NOTIFICATION:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_NOTIFICATION);
break;
case Constants.SOURCE_OTHER:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_OTHER);
break;
case Constants.SOURCE_PPWIDGET:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_PPW);
break;
case Constants.SOURCE_WIDGET:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_WIDGET);
break;
case Constants.SOURCE_C2DM:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_C2DM);
break;
case Constants.SOURCE_REENGAGEMENT:
StatisticsService.reportEvent(StatisticsConstants.LAUNCH_FROM_REENGAGEMENT);
}
getIntent().putExtra(TOKEN_SOURCE, Constants.SOURCE_DEFAULT); // Only report source once
}

@ -97,7 +97,6 @@ import com.todoroo.astrid.service.AddOnService;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.service.ThemeService;
@ -1198,9 +1197,7 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele
*/
protected void onTaskCompleted(Task item) {
if (isInbox) {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_INBOX);
} else {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_FILTER);
}
}
@ -1348,7 +1345,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele
Activity activity = getActivity();
switch(id) {
case MENU_SORT_ID:
StatisticsService.reportEvent(StatisticsConstants.TLA_MENU_SORT);
if (activity != null) {
AlertDialog dialog = SortSelectionActivity.createDialog(
getActivity(), hasDraggableOption(), this, sortFlags, sortSort);
@ -1356,7 +1352,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele
}
return true;
case MENU_SYNC_ID:
StatisticsService.reportEvent(StatisticsConstants.TLA_MENU_SYNC);
syncActionHelper.performSyncAction();
return true;
case MENU_ADDON_INTENT_ID:
@ -1466,7 +1461,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele
return;
}
StatisticsService.reportEvent(StatisticsConstants.TLA_MENU_SETTINGS);
Intent intent = new Intent(activity, EditPreferences.class);
startActivityForResult(intent, ACTIVITY_SETTINGS);
}

@ -25,7 +25,6 @@ import android.widget.Toast;
import com.timsu.astrid.R;
import com.todoroo.astrid.data.AddOn;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.utility.Constants;
/**
@ -59,7 +58,6 @@ public class AddOnAdapter extends ArrayAdapter<AddOn> {
if(buttonTag != null) {
try {
activity.startActivity(buttonTag.intent);
StatisticsService.reportEvent("addon-" + buttonTag.event); //$NON-NLS-1$
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.market_unavailable, Toast.LENGTH_LONG).show();
}

@ -9,7 +9,6 @@ import android.database.sqlite.SQLiteException;
import android.text.TextUtils;
import android.util.Log;
import com.crittercism.app.Crittercism;
import com.todoroo.andlib.data.AbstractDatabase;
import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.Property;
@ -163,7 +162,6 @@ public class Database extends AbstractDatabase {
}
@Override
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="SF_SWITCH_FALLTHROUGH")
protected synchronized boolean onUpgrade(int oldVersion, int newVersion) {
SqlConstructorVisitor visitor = new SqlConstructorVisitor();
switch(oldVersion) {
@ -416,7 +414,6 @@ public class Database extends AbstractDatabase {
database.execSQL(sql);
} catch (SQLiteException e) {
Log.e("astrid", "SQL Error: " + sql, e);
Crittercism.logHandledException(e);
}
}

@ -33,7 +33,6 @@ import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.TaskOutstanding;
import com.todoroo.astrid.provider.Astrid2TaskProvider;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.tags.TaskToTagMetadata;
import com.todoroo.astrid.utility.AstridPreferences;
@ -48,7 +47,6 @@ public class MetadataDao extends DatabaseDao<Metadata> {
@Autowired
private Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public MetadataDao() {
super(Metadata.class);
DependencyInjectionService.getInstance().inject(this);
@ -176,7 +174,6 @@ public class MetadataDao extends DatabaseDao<Metadata> {
if(Preferences.getBoolean(AstridPreferences.P_FIRST_LIST, true)) {
if (state && item.containsNonNullValue(Metadata.KEY) &&
item.getValue(Metadata.KEY).equals(TaskToTagMetadata.KEY)) {
StatisticsService.reportEvent(StatisticsConstants.USER_FIRST_LIST);
Preferences.setBoolean(AstridPreferences.P_FIRST_LIST, false);
}
}

@ -22,7 +22,6 @@ public class StoreObjectDao extends DatabaseDao<StoreObject> {
@Autowired
private Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public StoreObjectDao() {
super(StoreObject.class);
DependencyInjectionService.getInstance().inject(this);

@ -21,7 +21,6 @@ public class TagDataDao extends RemoteModelDao<TagData> {
@Autowired Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public TagDataDao() {
super(TagData.class);
DependencyInjectionService.getInstance().inject(this);

@ -48,7 +48,6 @@ public class TagMetadataDao extends DatabaseDao<TagMetadata> {
@Autowired
private Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public TagMetadataDao() {
super(TagMetadata.class);
DependencyInjectionService.getInstance().inject(this);

@ -33,7 +33,6 @@ public class TaskAttachmentDao extends RemoteModelDao<TaskAttachment> {
@Autowired Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public TaskAttachmentDao() {
super(TaskAttachment.class);
DependencyInjectionService.getInstance().inject(this);

@ -43,7 +43,6 @@ public class TaskDao extends RemoteModelDao<Task> {
@Autowired
private Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public TaskDao() {
super(Task.class);
DependencyInjectionService.getInstance().inject(this);

@ -26,7 +26,6 @@ public class TaskListMetadataDao extends RemoteModelDao<TaskListMetadata> {
@Autowired Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public TaskListMetadataDao() {
super(TaskListMetadata.class);
DependencyInjectionService.getInstance().inject(this);

@ -21,7 +21,6 @@ public class UpdateDao extends RemoteModelDao<Update> {
@Autowired Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public UpdateDao() {
super(Update.class);
DependencyInjectionService.getInstance().inject(this);

@ -13,7 +13,6 @@ import com.todoroo.astrid.data.User;
public class UserDao extends RemoteModelDao<User> {
@Autowired Database database;
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="UR_UNINIT_READ")
public UserDao() {
super(User.class);
DependencyInjectionService.getInstance().inject(this);

@ -30,7 +30,6 @@ import com.todoroo.astrid.dao.TaskDao.TaskCriteria;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.service.AstridDependencyInjector;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.tags.TagService.Tag;
@ -273,7 +272,6 @@ public class Astrid2TaskProvider extends ContentProvider {
task.setValue(Task.COMPLETION_DATE,
values.getAsBoolean(COMPLETED) ? DateUtilities.now() : 0);
if(task.isCompleted()) {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_API2);
}
}

@ -25,7 +25,6 @@ import android.media.AudioManager;
import android.util.Log;
import android.widget.Toast;
import com.crittercism.app.Crittercism;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.DatabaseDao.ModelUpdateListener;
import com.todoroo.andlib.data.TodorooCursor;
@ -149,10 +148,6 @@ public class StartupService {
// sets up context manager
ContextManager.setContext(context);
if(!StatisticsService.dontCollectStatistics()) {
Crittercism.init(context.getApplicationContext(), Constants.CRITTERCISM_APP_ID);
}
try {
database.openForWriting();
checkForMissingColumns();
@ -344,9 +339,7 @@ public class StartupService {
File[] children = directory.listFiles();
AndroidUtilities.sortFilesByDateDesc(children);
if(children.length > 0) {
StatisticsService.sessionStart(context);
TasksXmlImporter.importTasks(context, children[0].getAbsolutePath(), null);
StatisticsService.reportEvent(StatisticsConstants.LOST_TASKS_RESTORED);
}
}
} catch (Exception e) {
@ -359,7 +352,6 @@ public class StartupService {
private void checkForSubtasksUse() {
if (!Preferences.getBoolean(PREF_SUBTASKS_CHECK, false)) {
if (taskService.countTasks() > 3) {
StatisticsService.reportEvent(StatisticsConstants.SUBTASKS_HAS_TASKS);
checkMetadataStat(Criterion.and(MetadataCriteria.withKey(SubtasksMetadata.METADATA_KEY),
SubtasksMetadata.ORDER.gt(0)), StatisticsConstants.SUBTASKS_ORDER_USED);
checkMetadataStat(Criterion.and(MetadataCriteria.withKey(SubtasksMetadata.METADATA_KEY),
@ -377,7 +369,6 @@ public class StartupService {
if (!Preferences.getBoolean(PREF_SWIPE_CHECK, false)) {
if (Preferences.getBoolean(R.string.p_swipe_lists_enabled, false)
&& Preferences.getBoolean(TaskListFragmentPager.PREF_SHOWED_SWIPE_HELPER, false)) {
StatisticsService.reportEvent(StatisticsConstants.SWIPE_USED);
}
Preferences.setBoolean(PREF_SWIPE_CHECK, true);
}
@ -388,7 +379,6 @@ public class StartupService {
private void checkForVoiceRemindersUse() {
if (!Preferences.getBoolean(PREF_VOICE_REMINDERS_CHECK, false)) {
if (Preferences.getBoolean(R.string.p_voiceRemindersEnabled, false)) {
StatisticsService.reportEvent(StatisticsConstants.VOICE_REMINDERS_ENABLED);
Preferences.setBoolean(PREF_VOICE_REMINDERS_CHECK, true);
}
}
@ -398,7 +388,6 @@ public class StartupService {
TodorooCursor<Metadata> sort = metadataService.query(Query.select(Metadata.ID).where(criterion).limit(1));
try {
if (sort.getCount() > 0) {
StatisticsService.reportEvent(statistic);
}
} finally {
sort.close();

@ -42,7 +42,6 @@ public class StatisticsConstants {
public static final String TLA_MENU_SETTINGS = "tla-menu-settings";
public static final String TLA_MENU_SORT = "tla-menu-sort";
public static final String TLA_MENU_SYNC = "tla-menu-sync";
public static final String TLA_CRITTERCISM = "tla-crittercism";
public static final String TLA_MENU_HELP = "tla-menu-help";
public static final String V2_TASK_REPEAT = "v2-task-repeat";
public static final String TASK_COMPLETED_INBOX = "task-completed-inbox";

@ -1,113 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
import java.util.HashMap;
import android.app.Activity;
import android.content.Context;
import com.localytics.android.LocalyticsSession;
import com.timsu.astrid.R;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.utility.Constants;
public class StatisticsService {
private static LocalyticsSession localyticsSession;
/**
* Indicate session started
*
* @param context
*/
public static void sessionStart(Context context) {
if(dontCollectStatistics()) {
return;
}
if(localyticsSession != null) {
localyticsSession.open(); // Multiple calls to open are ok, we just need to make sure it gets reopened after pause
} else {
localyticsSession = new LocalyticsSession(context.getApplicationContext(),
Constants.LOCALYTICS_KEY);
localyticsSession.open();
localyticsSession.upload();
}
if (context instanceof Activity) {
localyticsSession.tagScreen(context.getClass().getSimpleName());
}
}
/**
* Indicate session ended
*
* @param context
*/
public static void sessionStop(Context context) {
if(dontCollectStatistics()) {
return;
}
if(localyticsSession != null) {
localyticsSession.upload();
}
}
/**
* Indicate session was paused
*/
public static void sessionPause() {
if(dontCollectStatistics()) {
return;
}
if(localyticsSession != null) {
localyticsSession.close();
}
}
/**
* Indicates an error occurred
* @param name
* @param message
* @param trace
*/
public static void reportError(String name, String message, String trace) {
// no reports yet
}
/**
* Indicates an event should be reported
* @param event
*/
public static void reportEvent(String event, String... attributes) {
if(dontCollectStatistics()) {
return;
}
if(localyticsSession != null) {
if(attributes.length > 0) {
HashMap<String, String> attrMap = new HashMap<String, String>();
for(int i = 1; i < attributes.length; i += 2) {
if(attributes[i] != null) {
attrMap.put(attributes[i - 1], attributes[i]);
}
}
localyticsSession.tagEvent(event, attrMap);
} else {
localyticsSession.tagEvent(event);
}
}
}
public static boolean dontCollectStatistics() {
return !Preferences.getBoolean(R.string.p_statistics, true);
}
}

@ -148,14 +148,11 @@ public class TaskService {
long diff = DateUtilities.now() - reminderLast;
if (diff > 0 && diff < DateUtilities.ONE_DAY) {
// within one day of last reminder
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_ONE_DAY, "social", socialReminder); //$NON-NLS-1$
}
if (diff > 0 && diff < DateUtilities.ONE_WEEK) {
// within one week of last reminder
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_ONE_WEEK, "social", socialReminder); //$NON-NLS-1$
}
}
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_V2);
} else {
item.setValue(Task.COMPLETION_DATE, 0L);
}

@ -25,7 +25,6 @@ import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.dao.ABTestEventDao;
import com.todoroo.astrid.data.ABTestEvent;
import com.todoroo.astrid.service.StartupService;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
/**
@ -89,55 +88,11 @@ public final class ABTestEventReportingService {
private void pushAllUnreportedABTestEvents() {
synchronized(ABTestEventReportingService.class) {
if (StatisticsService.dontCollectStatistics()) {
return;
}
final TodorooCursor<ABTestEvent> unreported = abTestEventDao.query(Query.select(ABTestEvent.PROPERTIES)
.where(ABTestEvent.REPORTED.eq(0))
.orderBy(Order.asc(ABTestEvent.TEST_NAME), Order.asc(ABTestEvent.TIME_INTERVAL)));
if (unreported.getCount() > 0) {
try {
JSONArray payload = jsonArrayFromABTestEvents(unreported);
abTestInvoker.post(ABTestInvoker.AB_RETENTION_METHOD, payload);
ABTestEvent model = new ABTestEvent();
for (unreported.moveToFirst(); !unreported.isAfterLast(); unreported.moveToNext()) {
model.readFromCursor(unreported);
model.setValue(ABTestEvent.REPORTED, 1);
abTestEventDao.saveExisting(model);
}
} catch (JSONException e) {
handleException(e);
} catch (IOException e) {
handleException(e);
} finally {
unreported.close();
}
}
}
}
private void reportUserActivation() {
synchronized (ABTestEventReportingService.class) {
if (StatisticsService.dontCollectStatistics()) {
return;
}
if (Preferences.getBoolean(PREF_REPORTED_ACTIVATION, false) || !taskService.getUserActivationStatus()) {
return;
}
final TodorooCursor<ABTestEvent> variants = abTestEventDao.query(Query.select(ABTestEvent.PROPERTIES)
.groupBy(ABTestEvent.TEST_NAME));
try {
JSONArray payload = jsonArrayForActivationAnalytics(variants);
abTestInvoker.post(ABTestInvoker.AB_ACTIVATION_METHOD, payload);
Preferences.setBoolean(PREF_REPORTED_ACTIVATION, true);
} catch (JSONException e) {
handleException(e);
} catch (IOException e) {
handleException(e);
} finally {
variants.close();
}
}
}

@ -24,7 +24,6 @@ import com.todoroo.andlib.service.Autowired;
import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.andlib.service.RestClient;
import com.todoroo.andlib.utility.Preferences;
import com.todoroo.astrid.service.StatisticsService;
/**
* Invoker for communicating with the Astrid Analytics server
@ -51,21 +50,6 @@ public class ABTestInvoker {
}
public void reportAcquisition() {
if (!Preferences.getBoolean(PREF_REPORTED_ACQUISITION, false) &&
!StatisticsService.dontCollectStatistics()) {
new Thread(new Runnable() {
@Override
public void run() {
try {
HttpEntity postData = createPostData(null);
restClient.post(URL + ACQUISITION_METHOD, postData);
Preferences.setBoolean(PREF_REPORTED_ACQUISITION, true);
} catch (IOException e) {
// Ignored
}
}
}).start();
}
}
/**

@ -60,7 +60,6 @@ import com.todoroo.astrid.repeats.RepeatControlSet;
import com.todoroo.astrid.service.AddOnService;
import com.todoroo.astrid.service.MetadataService;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.TaskService;
import com.todoroo.astrid.utility.Flags;
import com.todoroo.astrid.voice.VoiceRecognizer;
@ -388,7 +387,6 @@ public class QuickAddBar extends LinearLayout {
fragment.onTaskCreated(task);
StatisticsService.reportEvent(StatisticsConstants.TASK_CREATED_TASKLIST);
return task;
} catch (Exception e) {
exceptionService.displayAndReportError(activity,

@ -18,7 +18,6 @@ import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.helper.TaskEditControlSet;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
/**
* Control set dealing with random reminder settings
@ -101,7 +100,6 @@ public class RandomReminderControlSet extends TaskEditControlSet {
int hourValue = hours[periodSpinner.getSelectedItemPosition()];
task.setValue(Task.REMINDER_PERIOD, hourValue * DateUtilities.ONE_HOUR);
if (task.getSetValues().containsKey(Task.REMINDER_PERIOD.name)) {
StatisticsService.reportEvent(StatisticsConstants.RANDOM_REMINDER_SAVED);
}
} else {
task.setValue(Task.REMINDER_PERIOD, 0L);

@ -12,12 +12,6 @@ public final class Constants {
// --- general application constants
/**
* LCL API Key
*/
public static final String LOCALYTICS_KEY_LITE = "f3a40b93823ac2024b062f2-d96a8860-4a2c-11e2-35ca-004b50a28849";
public static final String LOCALYTICS_KEY = "ae35a010c66a997ab129ab7-3e2adf46-8bb3-11e0-fe8b-007f58cb3154";
/**
* Application Package
*/
@ -78,10 +72,6 @@ public final class Constants {
/** Notification Manager id for astrid.com */
public static final int NOTIFICATION_ACTFM = -5;
// --- crittercism
public static final String CRITTERCISM_APP_ID = "4e8a796fddf5203b6f0097c5";
// --- amazon
public static final String AWS_ACCESS_KEY_ID = "AKIAJTVL4FOF4PRBKBNA";

@ -32,7 +32,6 @@ import com.todoroo.andlib.utility.DialogUtilities;
import com.todoroo.astrid.actfm.ActFmGoogleAuthActivity;
import com.todoroo.astrid.actfm.ActFmLoginActivity;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.viewpagerindicator.CirclePageIndicator;
public class WelcomeWalkthrough extends ActFmLoginActivity {
@ -113,7 +112,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
simpleLogin.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_SIMPLE);
final ProgressDialog pd = DialogUtilities.progressDialog(WelcomeWalkthrough.this, getString(R.string.gtasks_GLA_authenticating));
pd.show();
getAuthToken(email, pd);
@ -175,7 +173,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
rejectQuickLogin.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_SIMPLE_REJECTED);
switchToLoginPage();
}
});

@ -23,7 +23,6 @@ import com.todoroo.astrid.api.Filter;
import com.todoroo.astrid.api.FilterListItem;
import com.todoroo.astrid.api.FilterWithCustomIntent;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.StatisticsService;
import com.todoroo.astrid.service.ThemeService;
@SuppressWarnings("nls")
@ -82,8 +81,6 @@ abstract public class WidgetConfigActivity extends ListActivity {
Button button = (Button)findViewById(R.id.ok);
button.setOnClickListener(mOnClickListener);
StatisticsService.reportEvent(StatisticsConstants.WIDGET_CONFIG);
}
View.OnClickListener mOnClickListener = new View.OnClickListener() {
@ -114,14 +111,12 @@ abstract public class WidgetConfigActivity extends ListActivity {
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
adapter.registerRecevier();
}
@Override
protected void onPause() {
super.onPause();
StatisticsService.sessionPause();
adapter.unregisterRecevier();
}
@ -133,7 +128,6 @@ abstract public class WidgetConfigActivity extends ListActivity {
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
ThemeService.setForceFilterInvert(false);
}

Loading…
Cancel
Save