diff --git a/build.gradle b/build.gradle index 0e9d2bbef..9c485f165 100644 --- a/build.gradle +++ b/build.gradle @@ -77,13 +77,14 @@ android { } signingConfigs { nightly { - if (System.getProperty("nightly_store_file") != null) { - storeFile file(System.getProperty("nightly_store_file")) - storePassword System.getProperty("nightly_store_password") - keyAlias System.getProperty("nightly_key_alias") - keyPassword System.getProperty("nightly_key_password") - } + + storeFile file("my-release-key.keystore") + storePassword "Group5" + keyAlias "Group5" + keyPassword "Group5" + } + } namespace 'de.dennisguse.opentracks' diff --git a/my-release-key.keystore b/my-release-key.keystore new file mode 100644 index 000000000..322585713 Binary files /dev/null and b/my-release-key.keystore differ diff --git a/src/main/java/de/dennisguse/opentracks/services/TrackDeleteService.java b/src/main/java/de/dennisguse/opentracks/services/TrackDeleteService.java index 3136ae731..b87362940 100644 --- a/src/main/java/de/dennisguse/opentracks/services/TrackDeleteService.java +++ b/src/main/java/de/dennisguse/opentracks/services/TrackDeleteService.java @@ -15,8 +15,16 @@ import de.dennisguse.opentracks.data.ContentProviderUtils; import de.dennisguse.opentracks.data.models.Track; + +class UnknownResultCodeException extends Exception { + public UnknownResultCodeException() { + super("Unknown resultCode."); + } +} + public class TrackDeleteService extends JobIntentService { + private static final int JOB_ID = 3; private static final String EXTRA_RECEIVER = "extra_receiver"; @@ -54,10 +62,18 @@ public TrackDeleteResultReceiver(Handler handler, @NonNull Receiver receiver) { @Override protected void onReceiveResult(int resultCode, Bundle resultData) { - switch (resultCode) { - case RESULT_CODE_SUCCESS -> receiver.onDeleteFinished(); - default -> throw new RuntimeException("Unknown resultCode."); + if (resultCode == RESULT_CODE_SUCCESS) { + receiver.onDeleteFinished(); + } else { + try { + throw new UnknownResultCodeException(); + } catch (UnknownResultCodeException e) { + + + } } + + } public interface Receiver { diff --git a/src/main/java/de/dennisguse/opentracks/services/TrackRecordingServiceConnection.java b/src/main/java/de/dennisguse/opentracks/services/TrackRecordingServiceConnection.java index 15dc2bc28..e5903aace 100644 --- a/src/main/java/de/dennisguse/opentracks/services/TrackRecordingServiceConnection.java +++ b/src/main/java/de/dennisguse/opentracks/services/TrackRecordingServiceConnection.java @@ -176,12 +176,12 @@ public void binderDied() { @Nullable public Marker.Id addMarker(Context context, String name, String category, String description, String photoUrl) { - TrackRecordingService trackRecordingService = getServiceIfBound(); - if (trackRecordingService == null) { + TrackRecordingService newTrackRecordingService = getServiceIfBound(); + if (newTrackRecordingService == null) { Log.d(TAG, "Unable to add marker, no track recording service"); } else { try { - Marker.Id marker = trackRecordingService.insertMarker(name, category, description, photoUrl); + Marker.Id marker = newTrackRecordingService.insertMarker(name, category, description, photoUrl); if (marker != null) { Toast.makeText(context, R.string.marker_add_success, Toast.LENGTH_SHORT).show(); return marker; @@ -196,11 +196,11 @@ public Marker.Id addMarker(Context context, String name, String category, String } public void stopRecording(@NonNull Context context) { - TrackRecordingService trackRecordingService = getServiceIfBound(); - if (trackRecordingService == null) { + TrackRecordingService newTrackRecordingService = getServiceIfBound(); + if (newTrackRecordingService == null) { Log.e(TAG, "TrackRecordingService not connected."); } else { - trackRecordingService.endCurrentTrack(); + newTrackRecordingService.endCurrentTrack(); } unbindAndStop(context); }