Skip to content

Commit

Permalink
Release 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
0xf4b1 committed Apr 3, 2020
1 parent 2057044 commit 91727eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.tiefensuche.motionmate"
minSdkVersion 14
targetSdkVersion 28
versionCode 6
versionName "1.3"
versionCode 7
versionName "1.3.1"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal class MotionService : Service() {
val manager = packageManager

// connect sensor
val mSensorManager = getSystemService(Context.SENSOR_SERVICE) as? SensorManager ?: throw RuntimeException()
val mSensorManager = getSystemService(Context.SENSOR_SERVICE) as? SensorManager ?: throw IllegalStateException("could not get sensor service")
var mStepSensor: Sensor? = null
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && manager.hasSystemFeature(PackageManager.FEATURE_SENSOR_STEP_COUNTER)) {
// androids built in step counter
Expand All @@ -90,7 +90,7 @@ internal class MotionService : Service() {
}

override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {

// no-op
}
}
} else if (manager.hasSystemFeature(PackageManager.FEATURE_SENSOR_ACCELEROMETER)) {
Expand All @@ -112,7 +112,7 @@ internal class MotionService : Service() {
}

override fun onAccuracyChanged(sensor: Sensor, accuracy: Int) {

// no-op
}
}
}
Expand Down Expand Up @@ -196,7 +196,7 @@ internal class MotionService : Service() {
}

private fun startService() {
mNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as? NotificationManager ?: throw RuntimeException()
mNotificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as? NotificationManager ?: throw IllegalStateException("could not get notification service")
val notificationIntent = Intent(this, MainActivity::class.java)
val pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0)
// Notification channels are only supported on Android O+.
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/tiefensuche/motionmate/util/Database.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class Database private constructor(context: Context) : SQLiteOpenHelper
FIELD_TYPE_INTEGER -> cursor.getLong(0)
FIELD_TYPE_FLOAT -> cursor.getFloat(0)
FIELD_TYPE_NULL -> 0
else -> throw Exception("unexpected type")
else -> throw IllegalStateException("unexpected type")
}
cursor.close()
return result
Expand Down Expand Up @@ -80,7 +80,7 @@ internal class Database private constructor(context: Context) : SQLiteOpenHelper
}

override fun onUpgrade(sqLiteDatabase: SQLiteDatabase, i: Int, i1: Int) {

// no-op
}

internal inner class Entry internal constructor(val timestamp: Long, val steps: Int)
Expand Down

0 comments on commit 91727eb

Please sign in to comment.