Remove subclasses from ContentSettingsManagerTest
ExportTest provides no value. ImportTest creates temporary files even if not needed.
This commit is contained in:
parent
8fceffd6fd
commit
122e80fae9
4 changed files with 106 additions and 154 deletions
|
|
@ -32,14 +32,9 @@ import org.schabi.newpipe.util.FilePickerActivityHelper;
|
|||
import org.schabi.newpipe.util.ZipHelper;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipFile;
|
||||
|
||||
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
|
||||
|
||||
|
|
@ -241,7 +236,7 @@ public class ContentSettingsFragment extends BasePreferenceFragment {
|
|||
}
|
||||
|
||||
//If settings file exist, ask if it should be imported.
|
||||
if (manager.containSettings(filePath)) {
|
||||
if (manager.extractSettings(filePath)) {
|
||||
final AlertDialog.Builder alert = new AlertDialog.Builder(getContext());
|
||||
alert.setTitle(R.string.import_settings);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class ContentSettingsManager(private val fileLocator: NewPipeFileLocator) {
|
|||
return success
|
||||
}
|
||||
|
||||
fun containSettings(filePath: String): Boolean {
|
||||
fun extractSettings(filePath: String): Boolean {
|
||||
return ZipHelper
|
||||
.extractFileFromZip(filePath, fileLocator.settings.path, "newpipe.settings")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue