forked from upstream-mirrors/OpenTracks
Merging to head.
This commit is contained in:
@@ -17,8 +17,8 @@ limitations under the License.
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.google.android.maps.mytracks"
|
package="com.google.android.maps.mytracks"
|
||||||
android:installLocation="auto"
|
android:installLocation="auto"
|
||||||
android:versionCode="27"
|
android:versionCode="28"
|
||||||
android:versionName="1.1.4">
|
android:versionName="1.1.5">
|
||||||
<application android:icon="@drawable/arrow_icon"
|
<application android:icon="@drawable/arrow_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent">
|
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent">
|
||||||
|
|||||||
@@ -525,6 +525,10 @@ public class TrackDataHub {
|
|||||||
|
|
||||||
// If this is the only listener we have registered, keep the state that we serve to it as
|
// If this is the only listener we have registered, keep the state that we serve to it as
|
||||||
// a reference for other future listeners.
|
// a reference for other future listeners.
|
||||||
|
if (isOnlyListener && reloadAll) {
|
||||||
|
resetState();
|
||||||
|
}
|
||||||
|
|
||||||
notifyPointsUpdated(isOnlyListener,
|
notifyPointsUpdated(isOnlyListener,
|
||||||
minPointId,
|
minPointId,
|
||||||
previousNumPoints,
|
previousNumPoints,
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ public class ZephyrMessageParser implements MessageParser {
|
|||||||
Log.w(Constants.TAG, "Got zephyr data: " + sb);
|
Log.w(Constants.TAG, "Got zephyr data: " + sb);
|
||||||
// Heart Rate
|
// Heart Rate
|
||||||
Sensor.SensorData.Builder heartrate = Sensor.SensorData.newBuilder()
|
Sensor.SensorData.Builder heartrate = Sensor.SensorData.newBuilder()
|
||||||
.setValue(buffer[12])
|
.setValue(buffer[12] & 0xFF)
|
||||||
.setState(Sensor.SensorState.SENDING);
|
.setState(Sensor.SensorState.SENDING);
|
||||||
// Changes Nico Laum (Power and Cadence)
|
// Changes Nico Laum (Power and Cadence)
|
||||||
Sensor.SensorData.Builder power = Sensor.SensorData.newBuilder()
|
Sensor.SensorData.Builder power = Sensor.SensorData.newBuilder()
|
||||||
|
|||||||
+8
-5
@@ -26,20 +26,23 @@ public class ZephyrMessageParserTest extends TestCase {
|
|||||||
|
|
||||||
public void testParseBuffer() {
|
public void testParseBuffer() {
|
||||||
byte[] buf = new byte[60];
|
byte[] buf = new byte[60];
|
||||||
buf[12] = 50;
|
// Heartrate (-1 =^ 255 unsigned byte)
|
||||||
|
buf[12] = -1;
|
||||||
|
// Power
|
||||||
buf[11] = 51;
|
buf[11] = 51;
|
||||||
buf[56] = 32;
|
// Cadence (=^ 255*16 strides/min)
|
||||||
buf[57] = 0;
|
buf[56] = -1;
|
||||||
|
buf[57] = 15;
|
||||||
Sensor.SensorDataSet sds = parser.parseBuffer(buf);
|
Sensor.SensorDataSet sds = parser.parseBuffer(buf);
|
||||||
assertTrue(sds.hasHeartRate());
|
assertTrue(sds.hasHeartRate());
|
||||||
assertTrue(sds.getHeartRate().getState() == Sensor.SensorState.SENDING);
|
assertTrue(sds.getHeartRate().getState() == Sensor.SensorState.SENDING);
|
||||||
assertEquals(50, sds.getHeartRate().getValue());
|
assertEquals(255, sds.getHeartRate().getValue());
|
||||||
assertTrue(sds.hasPower());
|
assertTrue(sds.hasPower());
|
||||||
assertTrue(sds.getPower().getState() == Sensor.SensorState.SENDING);
|
assertTrue(sds.getPower().getState() == Sensor.SensorState.SENDING);
|
||||||
assertEquals(51, sds.getPower().getValue());
|
assertEquals(51, sds.getPower().getValue());
|
||||||
assertTrue(sds.hasCadence());
|
assertTrue(sds.hasCadence());
|
||||||
assertTrue(sds.getCadence().getState() == Sensor.SensorState.SENDING);
|
assertTrue(sds.getCadence().getState() == Sensor.SensorState.SENDING);
|
||||||
assertEquals(2, sds.getCadence().getValue());
|
assertEquals(255, sds.getCadence().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFindNextAlignment() {
|
public void testFindNextAlignment() {
|
||||||
|
|||||||
Reference in New Issue
Block a user