reflect code revieww

This commit is contained in:
Markus M. May 2018-07-30 23:05:46 +02:00
parent 883bbf46e1
commit aca9b3ff65
2 changed files with 3 additions and 45 deletions

View file

@ -4,7 +4,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.support.v4.content.FileProvider; import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -23,14 +22,10 @@ import java.util.List;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.plugins.Food.FoodPlugin;
import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin;
import info.nightscout.utils.ImportExportPrefs;
import info.nightscout.utils.LoggerUtils; import info.nightscout.utils.LoggerUtils;
import info.nightscout.utils.SP; import info.nightscout.utils.SP;
@ -75,16 +70,6 @@ public class MaintenancePlugin extends PluginBase {
this.ctx = ctx; this.ctx = ctx;
} }
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
}
public void sendLogs() { public void sendLogs() {
String recipient = SP.getString("key_maintenance_logs_email", "logs@androidaps.org"); String recipient = SP.getString("key_maintenance_logs_email", "logs@androidaps.org");
int amount = SP.getInt("key_maintenance_logs_amount", 2); int amount = SP.getInt("key_maintenance_logs_amount", 2);
@ -148,7 +133,9 @@ public class MaintenancePlugin extends PluginBase {
/** /**
* returns a list of log files. The number of returned logs is given via the amount * returns a list of log files. The number of returned logs is given via the amount
* parameter. The log files are sorted by the name descending. * parameter.
*
* The log files are sorted by the name descending.
* *
* @param directory * @param directory
* @param amount * @param amount
@ -184,14 +171,6 @@ public class MaintenancePlugin extends PluginBase {
return result.subList(0, toIndex); return result.subList(0, toIndex);
} }
/**
* Zips the given files in a zipfile which is stored in the given zipDir using the givven
* name.
*
* @param zipFile
* @param files
* @return
*/
public File zipLogs(File zipFile, List<File> files) { public File zipLogs(File zipFile, List<File> files) {
LOG.debug("creating zip {}", zipFile.getAbsolutePath()); LOG.debug("creating zip {}", zipFile.getAbsolutePath());
@ -216,13 +195,6 @@ public class MaintenancePlugin extends PluginBase {
return "AndroidAPS_LOG_" + String.valueOf(new Date().getTime()) + LoggerUtils.SUFFIX; return "AndroidAPS_LOG_" + String.valueOf(new Date().getTime()) + LoggerUtils.SUFFIX;
} }
/**
* This method stores all given files inside the given zipFile.
*
* @param zipFile
* @param files
* @throws IOException
*/
public void zip(File zipFile, List<File> files) throws IOException { public void zip(File zipFile, List<File> files) throws IOException {
final int BUFFER_SIZE = 2048; final int BUFFER_SIZE = 2048;

View file

@ -1,14 +0,0 @@
package info.nightscout.utils;
import org.junit.Test;
import java.io.File;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class LoggerUtilsTest {
}