Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
… into group5
  • Loading branch information
jatin51997 committed Oct 13, 2023
2 parents 6bf0643 + b2d20e1 commit b07db03
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 15 deletions.
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Binary file added my-release-key.keystore
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit b07db03

Please sign in to comment.