Added sms behaviour
This commit is contained in:
parent
7264554de3
commit
1ed6ad198b
7 changed files with 157 additions and 22 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.ericsson.uecontrol.gui;
|
||||
|
||||
import android.app.ActionBar;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
|
|
@ -44,13 +45,15 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
private static UeControlExecutor currentExecutor;
|
||||
private static CSVWriter csvLogger;
|
||||
private static int uid;
|
||||
private static Context context;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Get UID
|
||||
// Set static fields
|
||||
uid = getApplicationInfo().uid;
|
||||
context = this;
|
||||
|
||||
// Setup Debugging
|
||||
setupDebugLogging();
|
||||
|
|
@ -70,7 +73,10 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
try {
|
||||
log.debug("Reading saved state");
|
||||
currentExecutor.read(input.getAbsolutePath());
|
||||
}catch(Exception e){log.error(null, e);}
|
||||
}catch(Exception e){
|
||||
Toast.makeText(this, "Unable to load saved state", Toast.LENGTH_SHORT).show();
|
||||
log.error(null, e);
|
||||
}
|
||||
}
|
||||
else{
|
||||
log.debug("No saved state found, creating default behaviours");
|
||||
|
|
@ -167,20 +173,6 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
public static UeControlExecutor getExecutor() {
|
||||
return currentExecutor;
|
||||
}
|
||||
|
||||
public static void logThroughput(double downThroughput, double upThroughput) {
|
||||
if(csvLogger == null || currentExecutor == null || currentExecutor.getRunningBehaviour() == null)
|
||||
return;
|
||||
|
||||
csvLogger.write(currentExecutor.getRunningBehaviour().getName(), downThroughput, upThroughput);
|
||||
}
|
||||
public static int getUID(){
|
||||
return uid;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
|
@ -199,4 +191,23 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void logThroughput(double downThroughput, double upThroughput) {
|
||||
if(csvLogger == null || currentExecutor == null || currentExecutor.getRunningBehaviour() == null)
|
||||
return;
|
||||
|
||||
csvLogger.write(currentExecutor.getRunningBehaviour().getName(), downThroughput, upThroughput);
|
||||
}
|
||||
|
||||
public static UeControlExecutor getExecutor() {
|
||||
return currentExecutor;
|
||||
}
|
||||
public static int getUID(){
|
||||
return uid;
|
||||
}
|
||||
public static Context getContext(){return context;}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue