Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/waqas #41

Merged
merged 10 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
id "org.sonarqube" version "4.4.1.3373"
}

sonar {
properties {
property "sonar.projectKey", "OmniaAlam_OpenTracks-Winter-SOEN-6431_2024"
property "sonar.organization", "omniaalam"
property "sonar.host.url", "https://sonarcloud.io"
}
}
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ 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{
throw new RuntimeException("Unknown resultCode.");
}

}

public interface Receiver {
void onDeleteFinished();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ private synchronized void startSensors() {
wakeLock = SystemUtils.acquireWakeLock(this, wakeLock);
trackPointCreator.start(this, handler);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
if (!PermissionRequester.RECORDING.hasPermission(this)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && !PermissionRequester.RECORDING.hasPermission(this)) {

throw new RuntimeException("Android14: Please grant permissions LOCATION and NEARBY DEVICES (manually)");
}

}

ServiceCompat.startForeground(this, TrackRecordingServiceNotificationManager.NOTIFICATION_ID, notificationManager.setGPSonlyStarted(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION + ServiceInfo.FOREGROUND_SERVICE_TYPE_CONNECTED_DEVICE);
Expand Down Expand Up @@ -285,7 +285,7 @@ public Marker.Id insertMarker(String name, String category, String description,
return trackRecordingManager.insertMarker(name, category, description, photoUrl);
}

@Deprecated
@Deprecated(since = "14.0.0", forRemoval = true)
@VisibleForTesting
public TrackPointCreator getTrackPointCreator() {
return trackPointCreator;
Expand Down Expand Up @@ -354,4 +354,4 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, @Null
trackPointCreator.onSharedPreferenceChanged(sharedPreferences, key);
notificationManager.onSharedPreferenceChanged(sharedPreferences, key);
}
}
}