Skip to content

Commit

Permalink
Minor changes to properly detect sensor failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeetay committed Sep 28, 2016
1 parent e086445 commit 2e48c4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,11 @@ public void onAccuracyChanged(Sensor sensor, int accuracy) {
};
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public static enum Slice {
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) {
Expand Down

0 comments on commit 2e48c4d

Please sign in to comment.