Skip to content

Commit

Permalink
Dev/waqas (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
qureshiwaqas committed Feb 16, 2024
2 parents 82b381e + aa15cd4 commit 9cbd992
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
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);
}
}
}

0 comments on commit 9cbd992

Please sign in to comment.