Reimplement storing backup import/export path
#6319 and #6402 were reverted before adding SAF changes, and have been readded at the end of SAF changes
This commit is contained in:
parent
5ffc667bea
commit
2a99e0e435
7 changed files with 155 additions and 55 deletions
|
|
@ -29,14 +29,13 @@ import com.nononsenseapps.filepicker.Utils;
|
|||
|
||||
import org.schabi.newpipe.R;
|
||||
import org.schabi.newpipe.settings.NewPipeSettings;
|
||||
import org.schabi.newpipe.streams.io.StoredFileHelper;
|
||||
import org.schabi.newpipe.util.FilePickerActivityHelper;
|
||||
import org.schabi.newpipe.util.ThemeHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import us.shandian.giga.get.DownloadMission;
|
||||
import org.schabi.newpipe.streams.io.StoredFileHelper;
|
||||
import us.shandian.giga.service.DownloadManager;
|
||||
import us.shandian.giga.service.DownloadManagerService;
|
||||
import us.shandian.giga.service.DownloadManagerService.DownloadManagerBinder;
|
||||
|
|
@ -242,9 +241,9 @@ public class MissionsFragment extends Fragment {
|
|||
private void recoverMission(@NonNull DownloadMission mission) {
|
||||
unsafeMissionTarget = mission;
|
||||
|
||||
final String startPath;
|
||||
final Uri initialPath;
|
||||
if (NewPipeSettings.useStorageAccessFramework(mContext)) {
|
||||
startPath = null;
|
||||
initialPath = null;
|
||||
} else {
|
||||
final File initialSavePath;
|
||||
if (DownloadManager.TAG_AUDIO.equals(mission.storage.getType())) {
|
||||
|
|
@ -252,11 +251,11 @@ public class MissionsFragment extends Fragment {
|
|||
} else {
|
||||
initialSavePath = NewPipeSettings.getDir(Environment.DIRECTORY_MOVIES);
|
||||
}
|
||||
startPath = initialSavePath.getAbsolutePath();
|
||||
initialPath = Uri.parse(initialSavePath.getAbsolutePath());
|
||||
}
|
||||
|
||||
startActivityForResult(StoredFileHelper.getNewPicker(mContext, startPath,
|
||||
mission.storage.getName(), mission.storage.getType()), REQUEST_DOWNLOAD_SAVE_AS);
|
||||
startActivityForResult(StoredFileHelper.getNewPicker(mContext, mission.storage.getName(),
|
||||
mission.storage.getType(), initialPath), REQUEST_DOWNLOAD_SAVE_AS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue