Skip to content

Commit

Permalink
Make the app default to the classic sensor code even if the phone rep… (
Browse files Browse the repository at this point in the history
sky-map-team#158)

* Make the app default to the classic sensor code even if the phone reports that it has a rotation vector sensor if it doesn't also have a gyro.  Too many phones lie about this.

* remove space

* Updated various versions.

* try updating the travis sdk to java 8
  • Loading branch information
jaydeetay authored Oct 1, 2016
1 parent 2e48c4d commit 944ded7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
# Use the Travis Container-Based Infrastructure
sudo: false

Expand All @@ -10,7 +10,7 @@ cache:

env:
global:
- ANDROID_API_LEVEL=23
- ANDROID_API_LEVEL=24
- EMULATOR_API_LEVEL=21
- ANDROID_BUILD_TOOLS_VERSION=23.0.3
- ANDROID_ABI=armeabi-v7a
Expand Down
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'

android {
compileSdkVersion 23
compileSdkVersion 24
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.google.android.stardroid"
minSdkVersion 15
targetSdkVersion 23
versionCode 1475
versionName "1.9.1f"
targetSdkVersion 24
versionCode 1480
versionName "1.9.2"
buildConfigField 'String', 'GOOGLE_ANALYTICS_CODE', '""'
}
signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,17 @@ private void performFeatureCheck() {
&& hasDefaultSensor(Sensor.TYPE_GYROSCOPE)) {
hasRotationSensor = true;
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "OK - All", 1);
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "OK - All Sensors", 1);
} else if (hasDefaultSensor(Sensor.TYPE_ACCELEROMETER) && hasDefaultSensor(
Sensor.TYPE_MAGNETIC_FIELD)) {
hasRotationSensor = true;
// Even though it allegedly has the rotation vector sensor too many gyro-less phones
// lie about this, so put these devices on the 'classic' sensor code for now.
hasRotationSensor = false;
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "OK - No gyro", 1);
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "Disabled - No gyro", 1);
} else {
analytics.trackEvent(
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "Missing Mag/Accel", 0);
Analytics.SENSOR_CATEGORY, Analytics.ROT_SENSOR_AVAILABILITY, "Disabled - Missing Mag/Accel", 0);
}
} else {
analytics.trackEvent(
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/whatsnew.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<string name="whats_new_text" translation_description="Description of new features in this version in html">
<![CDATA[
<h1>New in version %s</h1>
\t • Work around for a Samsung S4 and Note 3 bug that caused a crash on start up<br/>
\t • Using the gyro is now the default for phones that support it<br/>
\t • Workaround for a Samsung S4 and Note 3 bug that caused a crash on start up<br/>
\t • Workaround for a bug in some phones that misreport rotation sensor status<br/>
]]>
</string>
</resources>

0 comments on commit 944ded7

Please sign in to comment.