Commit 2e48c4d9 authored by John Taylor's avatar John Taylor

Minor changes to properly detect sensor failures.

parent e086445e
......@@ -9,8 +9,8 @@ android {
applicationId "com.google.android.stardroid"
minSdkVersion 15
targetSdkVersion 23
versionCode 1473
versionName "1.9.1d"
versionCode 1475
versionName "1.9.1f"
buildConfigField 'String', 'GOOGLE_ANALYTICS_CODE', '""'
}
signingConfigs {
......
......@@ -302,9 +302,11 @@ public class StardroidApplication extends Application {
};
boolean success = sensorManager.registerListener(
dummy, sensor, SensorManager.SENSOR_DELAY_UI);
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.SENSOR_LIAR, Analytics.getSafeNameForSensor(sensor),
1);
if (!success) {
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.SENSOR_LIAR, Analytics.getSafeNameForSensor(sensor),
1);
}
sensorManager.unregisterListener(dummy);
return success;
}
......
......@@ -112,7 +112,7 @@ public class Analytics {
public static final String HIGH_SENSOR_ACCURACY_ACHIEVED = "High Accuracy Achieved";
public static final String SENSOR_ACCURACY_CHANGED = "Sensor Accuracy Changed";
// Phone claims to have a sensor, but then doesn't allow registration of a listener.
public static final String SENSOR_LIAR = "Sensor Liar";
public static final String SENSOR_LIAR = "Sensor Liar!";
@Inject
Analytics(StardroidApplication application) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment