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

Commit

Permalink
GH-118: object shadowing problem solved
Browse files Browse the repository at this point in the history
  • Loading branch information
overlordiam committed Oct 13, 2023
1 parent c6836be commit b173c35
Showing 1 changed file with 6 additions and 6 deletions.
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 b173c35

Please sign in to comment.