Remove findbugs, localytics, crittercism

Alex Baker 13 years ago
parent ccae55568d
commit 41a8dbe07c

@ -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>

@ -386,7 +386,6 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
* @param showError 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

@ -216,11 +216,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"/>

@ -39,8 +39,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,94 +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,328 +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 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;
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;
/**
* 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) {
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,35 +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,556 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.localytics.android;
import android.Manifest.permission;
import org.json.JSONArray;
/**
* 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,94 +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 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 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 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;
@ -39,17 +38,4 @@ public class ActFmBackgroundService extends SyncV2BackgroundService {
protected SyncProviderUtilities getSyncUtilities() {
return actFmPreferenceService;
}
@Override
public void onCreate() {
super.onCreate();
StatisticsService.sessionStart(this);
}
@Override
public void onDestroy() {
StatisticsService.sessionStop(this);
super.onDestroy();
}
}

@ -26,7 +26,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;
import java.io.IOException;
import java.util.ArrayList;
@ -158,25 +157,6 @@ public class ActFmGoogleAuthActivity extends ListActivity {
finish();
}
@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;
@Override

@ -96,8 +96,6 @@ import com.todoroo.astrid.gtasks.auth.ModernAuthManager;
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;
@ -212,8 +210,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
recordPageView();
setResult(RESULT_CANCELED);
}
@ -231,14 +227,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
@ -247,16 +241,6 @@ public class ActFmLoginActivity extends SherlockFragmentActivity {
uiHelper.onDestroy();
}
@Override
protected void onStop() {
StatisticsService.sessionStop(this);
super.onStop();
}
protected void recordPageView() {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_SHOW);
}
protected void setupTermsOfService(TextView tos) {
OnClickListener showTosListener = new OnClickListener() {
@Override
@ -331,7 +315,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 +378,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 +444,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 +575,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);

@ -28,8 +28,6 @@ import com.todoroo.astrid.actfm.sync.ActFmSyncV2Provider;
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 +206,6 @@ public class ActFmPreferences extends SyncProviderPreferences {
} else {
Intent intent = new Intent(this, BillingActivity.class);
startActivity(intent);
StatisticsService.reportEvent(StatisticsConstants.PREMIUM_PAGE_VIEWED);
}
}

@ -51,7 +51,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 org.json.JSONArray;
import org.json.JSONObject;
@ -124,8 +123,6 @@ public abstract class CommentsFragment extends SherlockListFragment {
protected abstract UserActivity createUpdate();
protected abstract String commentAddStatistic();
protected abstract void performFetch(boolean manual, SyncMessageCallback done);
protected abstract boolean canLoadMoreHistory();
@ -412,8 +409,6 @@ public abstract class CommentsFragment extends SherlockListFragment {
resetPictureButton();
refreshUpdatesList();
StatisticsService.reportEvent(commentAddStatistic());
}
@Override

@ -53,8 +53,6 @@ import com.todoroo.astrid.data.User;
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;
@ -720,9 +718,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;

@ -32,7 +32,6 @@ import com.todoroo.astrid.data.TagData;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.UserActivity;
import com.todoroo.astrid.helper.AsyncImageView;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.TagDataService;
import com.todoroo.astrid.tags.TagService;
import com.todoroo.astrid.utility.AstridPreferences;
@ -171,11 +170,6 @@ public class TagCommentsFragment extends CommentsFragment {
return userActivity;
}
@Override
protected String commentAddStatistic() {
return StatisticsConstants.ACTFM_TAG_COMMENT;
}
@Override
protected void setLastViewed() {
if (tagData != null && RemoteModel.isValidUuid(tagData.getValue(TagData.UUID))) {

@ -55,8 +55,6 @@ import com.todoroo.astrid.data.TagMetadata;
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;
@ -382,7 +380,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.adapter.UpdateAdapter;
import com.todoroo.astrid.dao.TaskDao;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.data.UserActivity;
import com.todoroo.astrid.service.StatisticsConstants;
import com.todoroo.astrid.service.TaskService;
public class TaskCommentsFragment extends CommentsFragment {
@ -116,10 +115,4 @@ public class TaskCommentsFragment extends CommentsFragment {
update.setValue(UserActivity.CREATED_AT, DateUtilities.now());
return update;
}
@Override
protected String commentAddStatistic() {
return StatisticsConstants.ACTFM_TASK_COMMENT;
}
}

@ -13,8 +13,6 @@ import com.todoroo.astrid.billing.BillingConstants;
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;
@ -140,7 +138,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() {

@ -11,7 +11,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;
@ -382,7 +381,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();
}

@ -3,7 +3,6 @@ package com.todoroo.astrid.actfm.sync;
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;
@ -120,12 +119,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();
@ -150,11 +147,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();
@ -203,7 +198,6 @@ public class AstridNewSyncMigrator {
});
} catch (Exception e) {
Log.e(LOG_TAG, "Error asserting UUIDs", e);
Crittercism.logHandledException(e);
}
// --------------
@ -218,7 +212,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);
}
// --------------
@ -250,12 +243,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();
@ -302,13 +293,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();
@ -323,7 +312,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);
}
// --------------
@ -379,13 +367,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();
@ -411,7 +397,6 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating active tasks ordering", e);
Crittercism.logHandledException(e);
}
try {
@ -430,7 +415,6 @@ public class AstridNewSyncMigrator {
}
} catch (Exception e) {
Log.e(LOG_TAG, "Error migrating today ordering", e);
Crittercism.logHandledException(e);
}
TodorooCursor<TagData> allTagData = null;
@ -451,12 +435,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();
@ -503,13 +485,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();
@ -523,7 +503,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);
}
@ -559,12 +538,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();
@ -613,12 +590,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();

@ -3,7 +3,6 @@ package com.todoroo.astrid.actfm.sync.messages;
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;

@ -1,6 +1,5 @@
package com.todoroo.astrid.actfm.sync.messages;
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;
}
}

@ -9,9 +9,6 @@ import android.os.Environment;
import java.io.File;
import edu.umd.cs.findbugs.annotations.CheckForNull;
/**
* Constants for backup XML attributes and nodes.
*
@ -78,7 +75,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)) {

@ -49,7 +49,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;
@ -278,28 +277,15 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
}
}
@Override
protected void onStart() {
super.onStart();
}
@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);
}

@ -31,8 +31,6 @@ import com.todoroo.andlib.service.ExceptionService;
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;
@ -148,7 +146,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;
@ -30,17 +29,4 @@ public class GtasksBackgroundService extends SyncV2BackgroundService {
}
return gtasksPreferenceService;
}
@Override
public void onCreate() {
super.onCreate();
StatisticsService.sessionStart(this);
}
@Override
public void onDestroy() {
StatisticsService.sessionStop(this);
super.onDestroy();
}
}

@ -7,8 +7,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;
/**
@ -69,7 +67,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$
}
}

@ -32,7 +32,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;
import java.io.IOException;
@ -161,29 +160,6 @@ public class GtasksLoginActivity extends ListActivity {
finish();
}
@Override
protected void onStart() {
super.onStart();
}
@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;
@Override

@ -45,8 +45,6 @@ import com.todoroo.astrid.gtasks.api.GtasksInvoker;
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;
@ -393,7 +391,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

@ -27,8 +27,6 @@ import com.todoroo.astrid.api.Filter;
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;
/**
@ -207,9 +205,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);
}
}
@ -283,28 +278,15 @@ 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();
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
/**
* {@inheritDoc}
*/

@ -68,8 +68,6 @@ import com.todoroo.astrid.data.UserActivity;
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;
@ -557,7 +555,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) {

@ -27,8 +27,6 @@ import com.todoroo.astrid.activity.AstridActivity;
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;
import java.util.Date;
@ -61,7 +59,6 @@ public class NotificationFragment extends TaskListFragment {
@Override
protected void onTaskCompleted(Task item) {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_NOTIFICATION);
}
@Override

@ -38,8 +38,6 @@ import com.todoroo.astrid.data.TagMetadata;
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;
@ -85,7 +83,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() {

@ -56,7 +56,6 @@ public class ReminderPreferences extends TodorooPreferenceActivity {
int index = AndroidUtilities.indexOf(r.getStringArray(R.array.EPr_rmd_time_values), 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));
}

@ -31,8 +31,6 @@ import com.todoroo.andlib.service.DependencyInjectionService;
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;
@ -342,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();

@ -27,8 +27,6 @@ import com.todoroo.astrid.api.AstridApiConstants;
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;
@ -74,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);

@ -28,8 +28,6 @@ import com.todoroo.astrid.data.RemoteModel;
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;
@ -131,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)

@ -24,8 +24,6 @@ import com.todoroo.astrid.api.AstridApiConstants;
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 {
@ -63,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) {
@ -71,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.** {
*;
}

@ -27,10 +27,5 @@
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>

@ -43,8 +43,6 @@ import com.todoroo.astrid.dao.TaskDao;
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;
@ -112,7 +110,6 @@ public class AstridActivity extends SherlockFragmentActivity
DependencyInjectionService.getInstance().inject(this);
super.onCreate(savedInstanceState);
ContextManager.setContext(this);
StatisticsService.sessionStart(this);
new StartupService().onStartupApplication(this);
}
@ -131,16 +128,9 @@ 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);
}
/**
* Handles items being clicked from the filterlist-fragment. Return true if item is handled.
*/
@ -151,7 +141,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
@ -168,7 +157,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 {

@ -25,7 +25,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;
@ -49,8 +48,6 @@ import com.todoroo.astrid.helper.MetadataHelper;
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;
@ -125,12 +122,10 @@ public class EditPreferences extends TodorooPreferenceActivity {
private class SetDefaultsClickListener implements OnPreferenceClickListener {
private final AstridPreferenceSpec spec;
private final int nameId;
private final String statistic;
public SetDefaultsClickListener(AstridPreferenceSpec spec, int nameId, String statistic) {
public SetDefaultsClickListener(AstridPreferenceSpec spec, int nameId) {
this.spec = spec;
this.nameId = nameId;
this.statistic = statistic;
}
@Override
@ -140,7 +135,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();
}
@ -292,7 +286,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);
}
/**
@ -522,9 +515,6 @@ public class EditPreferences extends TodorooPreferenceActivity {
preference.setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED) {
@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 {
@ -595,8 +585,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)) {
} else if (booleanPreference(preference, value, R.string.p_calendar_reminders,
@ -682,10 +670,10 @@ public class EditPreferences extends TodorooPreferenceActivity {
findPreference(getString(R.string.p_hide_plus_button)).setOnPreferenceChangeListener(new SetResultOnPreferenceChangeListener(RESULT_CODE_PERFORMANCE_PREF_CHANGED));
findPreference(getString(R.string.p_config_default)).setOnPreferenceClickListener(
new SetDefaultsClickListener(new AstridDefaultPreferenceSpec(), R.string.EPr_config_dialog_default_id, StatisticsConstants.PREFS_RESET_DEFAULT));
new SetDefaultsClickListener(new AstridDefaultPreferenceSpec(), R.string.EPr_config_dialog_default_id));
findPreference(getString(R.string.p_config_lite)).setOnPreferenceClickListener(
new SetDefaultsClickListener(new AstridLitePreferenceSpec(), R.string.EPr_config_lite, StatisticsConstants.PREFS_RESET_LITE));
new SetDefaultsClickListener(new AstridLitePreferenceSpec(), R.string.EPr_config_lite));
int[] menuPrefs = {R.string.p_show_menu_search, R.string.p_show_menu_friends,
R.string.p_show_menu_sync, R.string.p_show_menu_sort,
@ -717,28 +705,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) {
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;
}
});
@ -747,7 +717,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;
}
});
@ -814,28 +783,4 @@ public class EditPreferences extends TodorooPreferenceActivity {
}
}
}
@Override
protected void onPause() {
StatisticsService.sessionPause();
super.onPause();
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onResume() {
super.onResume();
StatisticsService.sessionStart(this);
}
@Override
protected void onStop() {
StatisticsService.sessionStop(this);
super.onStop();
}
}

@ -25,8 +25,6 @@ import com.todoroo.andlib.service.Autowired;
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 +108,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;
@ -178,21 +177,9 @@ public class FilterListFragment extends SherlockListFragment {
* ============================================================ lifecycle
* ====================================================================== */
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
StatisticsService.sessionStop(getActivity());
super.onStop();
}
@Override
public void onResume() {
super.onResume();
StatisticsService.sessionStart(getActivity());
if (adapter != null) {
adapter.registerRecevier();
}
@ -214,7 +201,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,26 +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();
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
}
}

@ -15,8 +15,6 @@ import com.actionbarsherlock.app.ActionBar;
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 +43,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 +50,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);
}

@ -84,8 +84,6 @@ import com.todoroo.astrid.opencrx.OpencrxControlSet;
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;
@ -790,12 +788,8 @@ public final class TaskEditFragment extends SherlockFragment implements
}
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);
@ -1352,7 +1346,6 @@ public final class TaskEditFragment extends SherlockFragment implements
@Override
public void onPause() {
super.onPause();
StatisticsService.sessionPause();
if (shouldSaveState) {
save(true);
@ -1362,7 +1355,6 @@ public final class TaskEditFragment extends SherlockFragment implements
@Override
public void onResume() {
super.onResume();
StatisticsService.sessionStart(getActivity());
populateFields();
}
@ -1418,17 +1410,6 @@ public final class TaskEditFragment extends SherlockFragment implements
outState.putString(TASK_UUID, uuid.toString());
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
super.onStop();
StatisticsService.sessionStop(getActivity());
}
private void adjustInfoPopovers() {
Preferences.setBoolean(R.string.p_showed_tap_task_help, true);
if (!Preferences.isSet(getString(R.string.p_showed_lists_help))) {

@ -54,8 +54,6 @@ import com.todoroo.astrid.data.TagData;
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;
@ -865,22 +863,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
}

@ -40,7 +40,6 @@ import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockListFragment;
@ -91,8 +90,6 @@ import com.todoroo.astrid.reminders.ReminderDebugContextActions;
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;
@ -1205,11 +1202,6 @@ public class TaskListFragment extends SherlockListFragment implements OnSortSele
* @param item task that was completed
*/
protected void onTaskCompleted(Task item) {
if (isInbox) {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_INBOX);
} else {
StatisticsService.reportEvent(StatisticsConstants.TASK_COMPLETED_FILTER);
}
}
/**
@ -1358,7 +1350,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);
@ -1366,7 +1357,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:
@ -1476,7 +1466,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);
}

@ -23,7 +23,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;
import java.util.List;
@ -58,7 +57,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;
@ -161,7 +160,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) {
@ -432,7 +430,6 @@ public class Database extends AbstractDatabase {
database.execSQL(sql);
} catch (SQLiteException e) {
Log.e("astrid", "SQL Error: " + sql, e);
Crittercism.logHandledException(e);
}
}

@ -29,8 +29,6 @@ import com.todoroo.astrid.data.RemoteModel;
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;
@ -47,7 +45,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);
@ -181,7 +178,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);
}
}

@ -21,7 +21,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);

@ -47,7 +47,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);

@ -42,7 +42,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);

@ -14,7 +14,6 @@ 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);

@ -25,8 +25,6 @@ import com.todoroo.astrid.core.SortHelper;
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;
@ -272,7 +270,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);
}
}

@ -22,7 +22,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;
@ -167,10 +166,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();
@ -242,8 +237,6 @@ public class StartupService {
abChooser.makeChoicesForAllTests(latestSetVersion == 0, taskService.getUserActivationStatus());
abTestInvoker.reportAcquisition();
initializeDatabaseListeners();
ActFmSyncThread.initializeSyncComponents(taskDao, tagDataDao, userActivityDao, taskAttachmentDao, taskListMetadataDao, waitingOnMeDao);
@ -362,9 +355,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) {
@ -377,13 +368,12 @@ 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);
SubtasksMetadata.ORDER.gt(0)));
checkMetadataStat(Criterion.and(MetadataCriteria.withKey(SubtasksMetadata.METADATA_KEY),
SubtasksMetadata.INDENT.gt(0)), StatisticsConstants.SUBTASKS_INDENT_USED);
SubtasksMetadata.INDENT.gt(0)));
checkMetadataStat(Criterion.and(MetadataCriteria.withKey(GtasksMetadata.METADATA_KEY),
GtasksMetadata.INDENT.gt(0)), StatisticsConstants.GTASKS_INDENT_USED);
GtasksMetadata.INDENT.gt(0)));
}
Preferences.setBoolean(PREF_SUBTASKS_CHECK, true);
}
@ -395,7 +385,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);
}
@ -406,17 +395,15 @@ 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);
}
}
}
private void checkMetadataStat(Criterion criterion, String statistic) {
private void checkMetadataStat(Criterion criterion) {
TodorooCursor<Metadata> sort = metadataService.query(Query.select(Metadata.ID).where(criterion).limit(1));
try {
if (sort.getCount() > 0) {
StatisticsService.reportEvent(statistic);
}
} finally {
sort.close();

@ -1,96 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
@SuppressWarnings("nls")
public class StatisticsConstants {
public static final String EULA_ACCEPTED = "eula-accepted";
public static final String ACTFM_TAG_COMMENT = "actfm-tag-comment";
public static final String ACTFM_TASK_COMMENT = "actfm-task-comment";
public static final String ACTFM_NEW_USER = "actfm-new-user";
public static final String TASK_COMPLETED_V2 = "task-completed-v2";
public static final String TASK_COMPLETED_ONE_DAY = "task-completed-one-day";
public static final String TASK_COMPLETED_ONE_WEEK = "task-completed-one-week";
public static final String USER_FIRST_TASK = "user-first-task";
public static final String USER_FIRST_LIST = "user-first-list";
public static final String LOST_TASKS_RESTORED = "lost-tasks-restored";
public static final String CREATE_TASK = "create-task";
public static final String EDIT_TASK = "edit-task";
public static final String ACTFM_TASK_CREATED = "actfm-task-created";
public static final String ACTFM_TASK_COMPLETED = "actfm-task-completed";
public static final String ACTFM_LOGIN_GL_SUCCESS = "actfm-login-gl-success";
public static final String ACTFM_LOGIN_PW = "actfm-login-pw";
public static final String ACTFM_SIGNUP_PW = "actfm-signup-pw";
public static final String ACTFM_LOGIN_GL_START = "actfm-login-gl-start";
public static final String ACTFM_LOGIN_FB = "actfm-login-fb";
public static final String LAUNCH_FROM_NOTIFICATION = "launch-from-notification";
public static final String LAUNCH_FROM_OTHER = "launch-from-other";
public static final String LAUNCH_FROM_PPW = "launch-from-ppw";
public static final String LAUNCH_FROM_WIDGET = "launch-from-widget";
public static final String LAUNCH_FROM_C2DM = "launch-from-c2dm";
public static final String LAUNCH_FROM_REENGAGEMENT = "launch-from-reengagement";
public static final String LOCALE_EDIT_ALERTS_NO_PLUGIN = "locale-edit-alerts-no-plugin";
public static final String LOCALE_EDIT_ALERTS = "locale-edit-alerts";
public static final String WIDGET_CONFIG = "widget-config";
public static final String FILTER_LIST = "filter-list";
public static final String FILTER_SEARCH = "filter-search";
public static final String TLA_MENU_LISTS = "tla-menu-lists";
public static final String TLA_MENU_ADDONS = "tla-menu-addons";
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";
public static final String TASK_COMPLETED_FILTER = "task-completed-filter";
public static final String TASK_COMPLETED_NOTIFICATION = "task-completed-notification";
public static final String ACTFM_SYNC_FINISHED = "actfm-sync-finished";
public static final String ACTFM_SYNC_ERROR = "actfm-sync-error";
public static final String GTASKS_SYNC_FINISHED = "gtasks-sync-finished";
public static final String GTASKS_SYNC_ERROR = "gtasks-sync-error";
public static final String PDV_SYNC_FINISHED = "pdv-sync-finished";
public static final String TASK_CREATED_TASKLIST = "task-created-tasklist";
public static final String ACTFM_LOGIN_SHOW = "actfm-login-show";
public static final String ACTFM_TASK_SHARED = "actfm-task-shared";
public static final String TASK_ASSIGNED_EMAIL = "task-assigned-email";
public static final String TASK_ASSIGNED_PICKER = "task-assigned-picker";
public static final String TASK_SNOOZE = "task-snooze";
public static final String TASK_COMPLETED_API2 = "task-completed-api2";
public static final String TIMER_START = "timer-start";
public static final String TIMER_STOP = "timer-stop";
public static final String GTASKS_TASK_COMPLETED = "gtasks-task-completed";
public static final String PDV_TASK_COMPLETED = "pdv-task-completed";
public static final String CREATE_CALENDAR_EVENT = "create-calendar-event";
public static final String REPEAT_TASK_CREATE = "repeat-task-create";
public static final String ACTFM_LIST_SHARED = "actfm-list-shared";
public static final String IDEAS_LINK_CLICKED = "ideas-link-clicked";
public static final String SHARE_PAGE_VIEWED = "share-page-viewed";
public static final String SHARE_BUTTON_CLICKED = "share-button-clicked";
public static final String PREMIUM_PAGE_VIEWED = "premium-page-viewed";
public static final String FEATURED_LIST_CLONED = "featured-list-cloned";
public static final String RANDOM_REMINDER_SAVED = "random-rmdr-save";
public static final String PREFS_RESET_DEFAULT = "prefs-reset-default";
public static final String PREFS_RESET_LITE = "prefs-reset-lite";
public static final String ACTFM_LOGIN_SIMPLE = "actfm-login-simple";
public static final String ACTFM_LOGIN_SIMPLE_REJECTED = "actfm-login-simple-rejected";
public static final String SUBTASKS_HAS_TASKS = "subtasks-has-tasks";
public static final String SUBTASKS_ORDER_USED = "subtasks-order-used";
public static final String SUBTASKS_INDENT_USED = "subtasks-indent-used";
public static final String GTASKS_INDENT_USED = "gtasks-indent-used";
public static final String SWIPE_USED = "swipe_used";
public static final String PREF_THIRD_PARTY_ADDONS = "pref-third-party-addons";
public static final String PREF_SHOW_NOTES_IN_ROW = "pref-show-notes";
public static final String PREF_SHOW_FEATURED_LISTS = "pref-show-featured-lists";
public static final String PREF_CHANGED_PREFIX = "pref-changed-";
public static final String VOICE_REMINDERS_ENABLED = "voice-reminders-enabled";
}

@ -1,115 +0,0 @@
/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.service;
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;
import java.util.HashMap;
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);
}
}

@ -146,14 +146,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);
}

@ -18,7 +18,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;
import org.json.JSONArray;
@ -78,8 +77,6 @@ public final class ABTestEventReportingService {
public void run() {
try {
abTestEventDao.createRelativeDateEvents();
pushAllUnreportedABTestEvents();
// reportUserActivation();
} catch (SQLiteException e) {
StartupService.handleSQLiteError(context, e);
}
@ -87,60 +84,6 @@ public final class ABTestEventReportingService {
}).start();
}
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();
}
}
}
public JSONArray getTestsWithVariantsArray() {
JSONArray array = new JSONArray();
Set<String> tests = abTests.getAllTestKeys();

@ -9,7 +9,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;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpEntity;
@ -53,24 +52,6 @@ public class ABTestInvoker {
DependencyInjectionService.getInstance().inject(this);
}
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();
}
}
/**
* Posts the payload to the analytics server
*

@ -56,8 +56,6 @@ import com.todoroo.astrid.gcal.GCalHelper;
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;
@ -390,8 +388,6 @@ public class QuickAddBar extends LinearLayout {
}
fragment.onTaskCreated(task);
StatisticsService.reportEvent(StatisticsConstants.TASK_CREATED_TASKLIST);
return task;
} catch (Exception e) {
exceptionService.displayAndReportError(activity,

@ -17,8 +17,6 @@ import com.timsu.astrid.R;
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
@ -102,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
*/
@ -86,10 +80,6 @@ public final class Constants {
*/
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";

@ -28,8 +28,6 @@ import com.timsu.astrid.R;
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;
import java.io.IOException;
@ -113,7 +111,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 +172,6 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
rejectQuickLogin.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
StatisticsService.reportEvent(StatisticsConstants.ACTFM_LOGIN_SIMPLE_REJECTED);
switchToLoginPage();
}
});

@ -22,8 +22,6 @@ import com.todoroo.astrid.adapter.FilterAdapter;
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")
@ -81,8 +79,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() {
@ -112,26 +108,18 @@ 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();
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
StatisticsService.sessionStop(this);
ThemeService.setForceFilterInvert(false);
}
@ -165,5 +153,4 @@ abstract public class WidgetConfigActivity extends ListActivity {
}
}
}
}

Loading…
Cancel
Save