Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.application'

android {

compileSdkVersion 32
compileSdkVersion 33

defaultConfig {
applicationId "be.ppareit.swiftp"
minSdkVersion 23
targetSdkVersion 32
targetSdkVersion 33
versionCode 30100
versionName "3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/be/ppareit/swiftp/FsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public void onTaskRemoved(Intent rootIntent) {
Intent restartService = new Intent(getApplicationContext(), this.getClass());
restartService.setPackage(getPackageName());
PendingIntent restartServicePI = PendingIntent.getService(
getApplicationContext(), 1, restartService, PendingIntent.FLAG_ONE_SHOT);
getApplicationContext(), 1, restartService, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
AlarmManager alarmService = (AlarmManager) getApplicationContext()
.getSystemService(Context.ALARM_SERVICE);
alarmService.set(AlarmManager.ELAPSED_REALTIME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public static Notification setupNotification(Context context) {
int importance = NotificationManager.IMPORTANCE_DEFAULT;
NotificationChannel channel = new NotificationChannel(channelId, name, importance);
channel.setDescription(description);
channel.setShowBadge(false);
nm.createNotificationChannel(channel);
}

Expand Down
16 changes: 14 additions & 2 deletions app/src/main/java/be/ppareit/swiftp/gui/PreferenceFragment.java
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct.

Wish I would have seen this earlier.

The onCreate has just been changed in a little different way. Instead of asking the user to press the hidden option, the app now opens the Scoped storage chooser itself. Does this work for you?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can actually remove the check too if wanted. The intent of use was its seen in a bad state but technically could just leave that for the user to deal without the extra helpful smoothing out of it :)

Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import android.text.util.Linkify;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;

Expand Down Expand Up @@ -78,7 +78,19 @@ public void onCreate(Bundle savedInstanceState) {
updateRunningState();
runningPref.setOnPreferenceChangeListener((preference, newValue) -> {
if ((Boolean) newValue) {
FsService.start();
if (FsSettings.getExternalStorageUri() != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
FsService.start();
} else {
AlertDialog.Builder adb = new AlertDialog.Builder(getActivity());
adb.setTitle("Write External Storage is Required");
adb.setMessage("Please set the starting directory at Advanced Settings->Writing external storage");
adb.setPositiveButton("Ok", (dialog, which) -> {
dialog.dismiss();
runningPref.setChecked(false);
});
adb.show();
FsService.stop();
}
} else {
FsService.stop();
}
Expand Down