mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-07 20:03:06 +02:00
Allow starting the Dashboard API automatically from the StartRecording API
Fixes #1116.
This commit is contained in:
committed by
Dennis Guse
parent
7ca6925e7d
commit
1e4e7b8c15
@@ -1,11 +1,25 @@
|
||||
package de.dennisguse.opentracks.publicapi;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import de.dennisguse.opentracks.data.models.Track;
|
||||
import de.dennisguse.opentracks.services.TrackRecordingService;
|
||||
import de.dennisguse.opentracks.settings.PreferencesUtils;
|
||||
import de.dennisguse.opentracks.util.IntentDashboardUtils;
|
||||
|
||||
public class StartRecording extends AbstractAPIActivity {
|
||||
private static final String TAG = StartRecording.class.getSimpleName();
|
||||
|
||||
protected void execute(TrackRecordingService service) {
|
||||
service.startNewTrack();
|
||||
Track.Id trackId = service.startNewTrack();
|
||||
if ((trackId != null) && (PreferencesUtils.isPublicAPIDashboardEnabled())) {
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
if (bundle != null) {
|
||||
String targetPackage = bundle.getString("STATS_TARGET_PACKAGE", null);
|
||||
String targetClass = bundle.getString("STATS_TARGET_CLASS", null);
|
||||
IntentDashboardUtils.startDashboard(this, true, targetPackage, targetClass, trackId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user