Decoupled throughput updates from behaviours
Optimized imports
This commit is contained in:
parent
9323c099ce
commit
e00d1fcb62
17 changed files with 83 additions and 127 deletions
|
|
@ -14,7 +14,6 @@ public abstract class UeBehaviour implements Serializable{
|
||||||
|
|
||||||
private transient boolean running;
|
private transient boolean running;
|
||||||
private transient BehaviourExecutionListener execListener;
|
private transient BehaviourExecutionListener execListener;
|
||||||
private transient DataHandledListener datahandledListener;
|
|
||||||
|
|
||||||
|
|
||||||
public synchronized void preRun() {
|
public synchronized void preRun() {
|
||||||
|
|
@ -58,23 +57,6 @@ public abstract class UeBehaviour implements Serializable{
|
||||||
protected void setProgress(float progress){
|
protected void setProgress(float progress){
|
||||||
if(execListener != null)
|
if(execListener != null)
|
||||||
execListener.progressChanged(progress);
|
execListener.progressChanged(progress);
|
||||||
|
|
||||||
// TODO: This is a dirty way of updating the throughput, should be changed
|
|
||||||
if(datahandledListener != null)
|
|
||||||
datahandledListener.handledIncomingData(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDataHandledListener(DataHandledListener listener) {
|
|
||||||
datahandledListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void setHandledIncomingData(long size){
|
|
||||||
if(datahandledListener != null)
|
|
||||||
datahandledListener.handledIncomingData(size);
|
|
||||||
}
|
|
||||||
protected void setHandledOutgoingData(long size){
|
|
||||||
if(datahandledListener != null)
|
|
||||||
datahandledListener.handledOutgoingData(size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -105,8 +87,4 @@ public abstract class UeBehaviour implements Serializable{
|
||||||
public void exception(Exception e);
|
public void exception(Exception e);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface DataHandledListener {
|
|
||||||
public void handledIncomingData(long size);
|
|
||||||
public void handledOutgoingData(long size);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ericsson.uecontrol.core;
|
package com.ericsson.uecontrol.core;
|
||||||
|
|
||||||
import android.net.TrafficStats;
|
import android.net.TrafficStats;
|
||||||
|
import android.os.Handler;
|
||||||
|
|
||||||
import com.ericsson.uecontrol.core.util.AbstractElementAdapter;
|
import com.ericsson.uecontrol.core.util.AbstractElementAdapter;
|
||||||
import com.ericsson.uecontrol.core.util.ThroughputCalculator;
|
import com.ericsson.uecontrol.core.util.ThroughputCalculator;
|
||||||
|
|
@ -11,15 +12,9 @@ import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import java.io.ObjectOutput;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.io.Writer;
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -27,7 +22,7 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* Created by ezivkoc on 2014-07-15.
|
* Created by ezivkoc on 2014-07-15.
|
||||||
*/
|
*/
|
||||||
public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListener {
|
public class UeControlExecutor implements Runnable{
|
||||||
private static final Logger log = Logger.getLogger(UeControlExecutor.class);
|
private static final Logger log = Logger.getLogger(UeControlExecutor.class);
|
||||||
|
|
||||||
private ArrayList<UeBehaviour> behaviours;
|
private ArrayList<UeBehaviour> behaviours;
|
||||||
|
|
@ -36,19 +31,15 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
private Thread thread;
|
private Thread thread;
|
||||||
private Gson gson;
|
private Gson gson;
|
||||||
|
|
||||||
private long previousRxBytes = TrafficStats.UNSUPPORTED;
|
private Handler handler;
|
||||||
private long previousTxBytes = TrafficStats.UNSUPPORTED;
|
private ThroughputUpdateRunnable throughputUpdateRunnable;
|
||||||
private boolean deviceBasedThroughput;
|
|
||||||
private ThroughputCalculator downloadSpeed;
|
|
||||||
private ThroughputCalculator uploadSpeed;
|
|
||||||
private ThroughputListener throughputListener;
|
private ThroughputListener throughputListener;
|
||||||
|
|
||||||
|
|
||||||
public UeControlExecutor(){
|
public UeControlExecutor(){
|
||||||
behaviours = new ArrayList<UeBehaviour>();
|
behaviours = new ArrayList<UeBehaviour>();
|
||||||
downloadSpeed = new ThroughputCalculator();
|
handler = new Handler();
|
||||||
uploadSpeed = new ThroughputCalculator();
|
throughputUpdateRunnable = new ThroughputUpdateRunnable();
|
||||||
deviceBasedThroughput = false;
|
|
||||||
|
|
||||||
gson = new GsonBuilder()
|
gson = new GsonBuilder()
|
||||||
.registerTypeAdapter(UeBehaviour.class, new AbstractElementAdapter<UeBehaviour>())
|
.registerTypeAdapter(UeBehaviour.class, new AbstractElementAdapter<UeBehaviour>())
|
||||||
|
|
@ -57,7 +48,6 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
|
|
||||||
public void addBehaviour(UeBehaviour b){
|
public void addBehaviour(UeBehaviour b){
|
||||||
behaviours.add(b);
|
behaviours.add(b);
|
||||||
b.setDataHandledListener(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void read(String file) throws Exception {
|
public void read(String file) throws Exception {
|
||||||
|
|
@ -78,8 +68,13 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public synchronized void execute(){
|
public synchronized void execute(){
|
||||||
if(!isRunning()) {
|
if(!isRunning()) {
|
||||||
|
// Start throughput reader scheduler
|
||||||
|
handler.postDelayed(throughputUpdateRunnable, 100);
|
||||||
|
|
||||||
|
// Start Execution
|
||||||
terminate = false;
|
terminate = false;
|
||||||
thread = new Thread(this);
|
thread = new Thread(this);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
@ -92,6 +87,7 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
}
|
}
|
||||||
|
|
||||||
private void terminateNonBlock(){
|
private void terminateNonBlock(){
|
||||||
|
handler.removeCallbacks(throughputUpdateRunnable);
|
||||||
terminate = true;
|
terminate = true;
|
||||||
if(currentlyActive != null)
|
if(currentlyActive != null)
|
||||||
currentlyActive.terminate();
|
currentlyActive.terminate();
|
||||||
|
|
@ -116,6 +112,8 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
currentlyActive = null;
|
currentlyActive = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isRunning(){
|
public boolean isRunning(){
|
||||||
return thread != null && thread.isAlive();
|
return thread != null && thread.isAlive();
|
||||||
}
|
}
|
||||||
|
|
@ -154,24 +152,54 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handledIncomingData(long size) {
|
public void setThroughputListener(ThroughputListener listener){
|
||||||
if (!setRealDataUsage()){
|
throughputListener = listener;
|
||||||
// TrafficStat unsupported so try to use estimation instead
|
|
||||||
downloadSpeed.setHandledData(size);
|
|
||||||
}
|
}
|
||||||
if (throughputListener != null && downloadSpeed.isUpdated())
|
public void setDeviceBasedThroughput(boolean enable){
|
||||||
throughputListener.throughputUpdate(downloadSpeed.getBitThroughput(), uploadSpeed.getBitThroughput());
|
throughputUpdateRunnable.deviceBasedThroughput = enable;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void handledOutgoingData(long size) {
|
public List<UeBehaviour> getBehaviourList() {
|
||||||
|
return behaviours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public UeBehaviour getRunningBehaviour(){
|
||||||
|
return currentlyActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static interface ThroughputListener{
|
||||||
|
public void throughputUpdate(double downThroughput, double upThroughput);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private class ThroughputUpdateRunnable implements Runnable{
|
||||||
|
protected boolean deviceBasedThroughput;
|
||||||
|
|
||||||
|
private long previousRxBytes = TrafficStats.UNSUPPORTED;
|
||||||
|
private long previousTxBytes = TrafficStats.UNSUPPORTED;
|
||||||
|
private ThroughputCalculator downloadSpeed;
|
||||||
|
private ThroughputCalculator uploadSpeed;
|
||||||
|
|
||||||
|
|
||||||
|
public ThroughputUpdateRunnable(){
|
||||||
|
downloadSpeed = new ThroughputCalculator();
|
||||||
|
uploadSpeed = new ThroughputCalculator();
|
||||||
|
deviceBasedThroughput = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(){
|
||||||
if (!setRealDataUsage()) {
|
if (!setRealDataUsage()) {
|
||||||
// TrafficStat unsupported so try to us estimation instead
|
uploadSpeed.setHandledData(0);
|
||||||
uploadSpeed.setHandledData(size);
|
downloadSpeed.setHandledData(0);
|
||||||
}
|
}
|
||||||
if (throughputListener != null && uploadSpeed.isUpdated())
|
if (throughputListener != null && uploadSpeed.isUpdated())
|
||||||
throughputListener.throughputUpdate(downloadSpeed.getBitThroughput(), uploadSpeed.getBitThroughput());
|
throughputListener.throughputUpdate(downloadSpeed.getBitThroughput(), uploadSpeed.getBitThroughput());
|
||||||
|
// Rescedule this handler
|
||||||
|
handler.postDelayed(this, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean setRealDataUsage(){
|
protected boolean setRealDataUsage(){
|
||||||
boolean ret = false;
|
boolean ret = false;
|
||||||
long currentRxBytes = 0;
|
long currentRxBytes = 0;
|
||||||
|
|
@ -187,7 +215,7 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
|
|
||||||
if (currentRxBytes != TrafficStats.UNSUPPORTED && currentTxBytes != TrafficStats.UNSUPPORTED
|
if (currentRxBytes != TrafficStats.UNSUPPORTED && currentTxBytes != TrafficStats.UNSUPPORTED
|
||||||
&& previousRxBytes != TrafficStats.UNSUPPORTED && previousTxBytes != TrafficStats.UNSUPPORTED){
|
&& previousRxBytes != TrafficStats.UNSUPPORTED && previousTxBytes != TrafficStats.UNSUPPORTED){
|
||||||
downloadSpeed.setHandledData(currentRxBytes-previousRxBytes);
|
downloadSpeed.setHandledData(currentRxBytes - previousRxBytes);
|
||||||
uploadSpeed.setHandledData(currentTxBytes-previousTxBytes);
|
uploadSpeed.setHandledData(currentTxBytes-previousTxBytes);
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
@ -195,23 +223,5 @@ public class UeControlExecutor implements Runnable, UeBehaviour.DataHandledListe
|
||||||
previousTxBytes = currentTxBytes;
|
previousTxBytes = currentTxBytes;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setThroughputListener(ThroughputListener listener){
|
|
||||||
throughputListener = listener;
|
|
||||||
}
|
|
||||||
public void setDeviceBasedThroughput(boolean enable){
|
|
||||||
deviceBasedThroughput = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<UeBehaviour> getBehaviourList() {
|
|
||||||
return behaviours;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UeBehaviour getRunningBehaviour(){
|
|
||||||
return currentlyActive;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static interface ThroughputListener{
|
|
||||||
public void throughputUpdate(double downThroughput, double upThroughput);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ public class UeBehaviourFileDownload extends UeBehaviour {
|
||||||
while((read = in.read(data)) != -1 && !stopExecution()){
|
while((read = in.read(data)) != -1 && !stopExecution()){
|
||||||
progress += read;
|
progress += read;
|
||||||
super.setProgress((float)progress/estimatedDataLength);
|
super.setProgress((float)progress/estimatedDataLength);
|
||||||
super.setHandledIncomingData(read);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
estimatedDataLength = progress;
|
estimatedDataLength = progress;
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,9 @@
|
||||||
package com.ericsson.uecontrol.core.behaviour;
|
package com.ericsson.uecontrol.core.behaviour;
|
||||||
|
|
||||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
|
||||||
import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLConnection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This behaviour simulates downloading a file from FTP
|
* This behaviour simulates downloading a file from FTP
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
|
|
@ -49,7 +48,6 @@ public class UeBehaviourFtpUpload extends UeBehaviour {
|
||||||
out.write(data, 0, writeLength);
|
out.write(data, 0, writeLength);
|
||||||
|
|
||||||
total += writeLength;
|
total += writeLength;
|
||||||
super.setHandledOutgoingData(writeLength);
|
|
||||||
super.setProgress((float)total/size);
|
super.setProgress((float)total/size);
|
||||||
}
|
}
|
||||||
out.close();
|
out.close();
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,9 @@ import android.telephony.TelephonyManager;
|
||||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||||
import com.ericsson.uecontrol.core.util.CallUtil;
|
import com.ericsson.uecontrol.core.util.CallUtil;
|
||||||
import com.ericsson.uecontrol.gui.MainActivity;
|
import com.ericsson.uecontrol.gui.MainActivity;
|
||||||
import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This behaviour simulates an idle period for the device.
|
* This behaviour simulates an idle period for the device.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.telephony.SmsManager;
|
import android.telephony.SmsManager;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||||
import com.ericsson.uecontrol.gui.MainActivity;
|
import com.ericsson.uecontrol.gui.MainActivity;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.ericsson.uecontrol.core.behaviour;
|
package com.ericsson.uecontrol.core.behaviour;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||||
|
|
@ -12,9 +10,6 @@ import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This behaviour simulates an idle period for the device.
|
* This behaviour simulates an idle period for the device.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
package com.ericsson.uecontrol.core.behaviour;
|
package com.ericsson.uecontrol.core.behaviour;
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.ericsson.uecontrol.core.UeBehaviour;
|
import com.ericsson.uecontrol.core.UeBehaviour;
|
||||||
import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
import com.ericsson.uecontrol.gui.util.Configurator.Configurable;
|
||||||
|
|
||||||
|
|
@ -14,9 +12,7 @@ import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Queue;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -93,7 +89,6 @@ public class UeBehaviourSurfing extends UeBehaviour {
|
||||||
return;
|
return;
|
||||||
totalRead += read;
|
totalRead += read;
|
||||||
super.setProgress((float) totalRead / estimatedDataLength);
|
super.setProgress((float) totalRead / estimatedDataLength);
|
||||||
super.setHandledIncomingData(read);
|
|
||||||
if (cont.parsable)
|
if (cont.parsable)
|
||||||
content.append(new String(data, 0, read));
|
content.append(new String(data, 0, read));
|
||||||
if (content.length() > MAX_BUFFER_SIZE)
|
if (content.length() > MAX_BUFFER_SIZE)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ import org.apache.log4j.Logger;
|
||||||
import org.dom4j.Attribute;
|
import org.dom4j.Attribute;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
import org.dom4j.Element;
|
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
|
@ -51,7 +50,7 @@ public class UeBehaviourVideoStreaming extends UeBehaviour implements MediaPlaye
|
||||||
Thread.sleep(UeBehaviourSleep.SLEEP_PERIOD);
|
Thread.sleep(UeBehaviourSleep.SLEEP_PERIOD);
|
||||||
while (mp.isPlaying() && playbackException == null) {
|
while (mp.isPlaying() && playbackException == null) {
|
||||||
super.setProgress((float) mp.getCurrentPosition() / mp.getDuration());
|
super.setProgress((float) mp.getCurrentPosition() / mp.getDuration());
|
||||||
super.setHandledIncomingData(0); // Unable to retrieve the amount of incoming data
|
|
||||||
if (super.stopExecution()) break;
|
if (super.stopExecution()) break;
|
||||||
Thread.sleep(UeBehaviourSleep.SLEEP_PERIOD);
|
Thread.sleep(UeBehaviourSleep.SLEEP_PERIOD);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,14 @@
|
||||||
package com.ericsson.uecontrol.core.util;
|
package com.ericsson.uecontrol.core.util;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.JsonDeserializationContext;
|
||||||
|
import com.google.gson.JsonDeserializer;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
import com.google.gson.JsonPrimitive;
|
||||||
|
import com.google.gson.JsonSerializationContext;
|
||||||
|
import com.google.gson.JsonSerializer;
|
||||||
|
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
public class AbstractElementAdapter<T> implements JsonSerializer<T>, JsonDeserializer<T> {
|
public class AbstractElementAdapter<T> implements JsonSerializer<T>, JsonDeserializer<T> {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import com.ericsson.uecontrol.BuildConfig;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,11 @@ import com.ericsson.uecontrol.core.UeControlExecutor;
|
||||||
import com.ericsson.uecontrol.gui.fragments.ConfigureDialog;
|
import com.ericsson.uecontrol.gui.fragments.ConfigureDialog;
|
||||||
import com.ericsson.uecontrol.gui.fragments.SelectBehaviourDialog;
|
import com.ericsson.uecontrol.gui.fragments.SelectBehaviourDialog;
|
||||||
import com.ericsson.uecontrol.gui.util.BehaviourListAdapter;
|
import com.ericsson.uecontrol.gui.util.BehaviourListAdapter;
|
||||||
import com.ericsson.uecontrol.gui.util.Configurator;
|
|
||||||
import com.ericsson.uecontrol.gui.util.DynamicListView;
|
import com.ericsson.uecontrol.gui.util.DynamicListView;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class EditActivity extends ListActivity implements AdapterView.OnItemClickListener {
|
public class EditActivity extends ListActivity implements AdapterView.OnItemClickListener {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
package com.ericsson.uecontrol.gui.fragments;
|
package com.ericsson.uecontrol.gui.fragments;
|
||||||
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
|
@ -33,6 +28,11 @@ import com.ericsson.uecontrol.R;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/** Allow user to select destination directory and to enter filename.
|
/** Allow user to select destination directory and to enter filename.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,6 @@ import com.ericsson.uecontrol.core.UeBehaviour;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class SelectBehaviourDialog extends DialogFragment {
|
public class SelectBehaviourDialog extends DialogFragment {
|
||||||
private static final Logger log = Logger.getLogger(SelectBehaviourDialog.class);
|
private static final Logger log = Logger.getLogger(SelectBehaviourDialog.class);
|
||||||
public static String[] behaviourClasses;
|
public static String[] behaviourClasses;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,9 @@
|
||||||
package com.ericsson.uecontrol.gui.fragments;
|
package com.ericsson.uecontrol.gui.fragments;
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.ConnectivityManager;
|
|
||||||
import android.net.NetworkInfo;
|
|
||||||
import android.net.wifi.WifiInfo;
|
|
||||||
import android.net.wifi.WifiManager;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
|
||||||
import android.telephony.TelephonyManager;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.wifi.WifiInfo;
|
import android.net.wifi.WifiInfo;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Build;
|
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.telephony.NeighboringCellInfo;
|
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.gsm.GsmCellLocation;
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
|
|
||||||
|
|
@ -21,7 +19,6 @@ import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by ezivkoc on 2014-07-30.
|
* Created by ezivkoc on 2014-07-30.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue