Skip to content

Commit

Permalink
Fix: Crash on meta remotes config on Android < API 24
Browse files Browse the repository at this point in the history
Ref: NoSuchMethodError @ CacheConfig.java:289
  • Loading branch information
x0b committed Apr 8, 2020
1 parent e631f0c commit 4958d83
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -131,7 +132,7 @@ private void setRemote() {
}

RemoteItem.prepareDisplay(context, remotes);
remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
String[] options = new String[remotes.size()];
int i = 0;
for (RemoteItem remote : remotes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import ca.pkay.rcloneexplorer.Dialogs.NumberPickerDialog;
Expand Down Expand Up @@ -286,7 +287,7 @@ private void setRemote() {
return;
}
RemoteItem.prepareDisplay(context, remotes);
remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
String[] options = new String[remotes.size()];
int i = 0;
for (RemoteItem remote : remotes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import ca.pkay.rcloneexplorer.Dialogs.PasswordGeneratorDialog;
Expand Down Expand Up @@ -289,7 +290,7 @@ private void setRemote() {
}

RemoteItem.prepareDisplay(context, remotes);
remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
String[] options = new String[remotes.size()];
int i = 0;
for (RemoteItem remote : remotes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class UnionConfig extends Fragment implements RemoteDestinationDialog.OnDestinationSelectedListener {
Expand Down Expand Up @@ -122,7 +123,7 @@ private void addRemote() {
}

RemoteItem.prepareDisplay(context, configuredRemotes);
configuredRemotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
Collections.sort(configuredRemotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
String[] options = new String[configuredRemotes.size()];
int i = 0;
for (RemoteItem remote : configuredRemotes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private void showAppShortcutDialog() {
Rclone rclone = new Rclone(context);
final ArrayList<RemoteItem> remotes = new ArrayList<>(rclone.getRemotes());
RemoteItem.prepareDisplay(context, remotes);
remotes.sort((a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
Collections.sort(remotes, (a, b) -> a.getDisplayName().compareTo(b.getDisplayName()));
final CharSequence[] options = new CharSequence[remotes.size()];
int i = 0;
for (RemoteItem remoteItem : remotes) {
Expand Down

0 comments on commit 4958d83

Please sign in to comment.