diff --git a/BatteryLifeLog/.classpath b/BatteryLifeLog/.classpath deleted file mode 100644 index 609aa00ebc..0000000000 --- a/BatteryLifeLog/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/BatteryLifeLog/.project b/BatteryLifeLog/.project deleted file mode 100644 index d4b9437afc..0000000000 --- a/BatteryLifeLog/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - BatteryLifeLog - - - - - - com.android.ide.eclipse.adt.ResourceManagerBuilder - - - - - com.android.ide.eclipse.adt.PreCompilerBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - com.android.ide.eclipse.adt.ApkBuilder - - - - - - com.android.ide.eclipse.adt.AndroidNature - org.eclipse.jdt.core.javanature - - diff --git a/BatteryLifeLog/AndroidManifest.xml b/BatteryLifeLog/AndroidManifest.xml deleted file mode 100644 index c2bb805fb5..0000000000 --- a/BatteryLifeLog/AndroidManifest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/BatteryLifeLog/default.properties b/BatteryLifeLog/default.properties deleted file mode 100644 index a1ef8e9ff4..0000000000 --- a/BatteryLifeLog/default.properties +++ /dev/null @@ -1,13 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system use, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Indicates whether an apk should be generated for each density. -split.density=false -# Project target. -target=android-3 diff --git a/BatteryLifeLog/res/drawable/icon.png b/BatteryLifeLog/res/drawable/icon.png deleted file mode 100644 index a07c69fa5a..0000000000 Binary files a/BatteryLifeLog/res/drawable/icon.png and /dev/null differ diff --git a/BatteryLifeLog/res/layout/main.xml b/BatteryLifeLog/res/layout/main.xml deleted file mode 100644 index 3155ab9952..0000000000 --- a/BatteryLifeLog/res/layout/main.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/BatteryLifeLog/res/layout/mytext.xml b/BatteryLifeLog/res/layout/mytext.xml deleted file mode 100644 index 5ff9c5ede0..0000000000 --- a/BatteryLifeLog/res/layout/mytext.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/BatteryLifeLog/res/menu/main_menu.xml b/BatteryLifeLog/res/menu/main_menu.xml deleted file mode 100644 index 991369eb0b..0000000000 --- a/BatteryLifeLog/res/menu/main_menu.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/BatteryLifeLog/res/values/strings.xml b/BatteryLifeLog/res/values/strings.xml deleted file mode 100644 index 968c9b1137..0000000000 --- a/BatteryLifeLog/res/values/strings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - Hello World, BatteryViewActivity! - BatteryLifeLog -Запустить сервис -Остановить сервис -#FFFFFF -Batter Log service - diff --git a/BatteryLifeLog/src/com/anvisics/battery/BatteryLogService.java b/BatteryLifeLog/src/com/anvisics/battery/BatteryLogService.java deleted file mode 100644 index 44a213d644..0000000000 --- a/BatteryLifeLog/src/com/anvisics/battery/BatteryLogService.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.anvisics.battery; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.List; - -import android.app.Service; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.BatteryManager; -import android.os.Binder; -import android.os.IBinder; -import android.text.format.DateFormat; - -public class BatteryLogService extends Service { - - @Override - public IBinder onBind(Intent intent) { - return binder; - } - - - private BatteryLogBinder binder = new BatteryLogBinder(); - private BatteryStatusReceiver batteryStatusReceiver; - - - public static class BatteryLogEntry { - private int batteryLevel; - private int batteryVoltage; - private long time; - private int plugged; - private int status; - - - public BatteryLogEntry(){ - time = System.currentTimeMillis(); - } - - public int getPlugged() { - return plugged; - } - public void setPlugged(int plugged) { - this.plugged = plugged; - } - public int getStatus() { - return status; - } - public void setStatus(int status) { - this.status = status; - } - public int getBatteryLevel() { - return batteryLevel; - } - public void setBatteryLevel(int batteryLevel) { - this.batteryLevel = batteryLevel; - } - public int getBatteryVoltage() { - return batteryVoltage; - } - public void setBatteryVoltage(int batteryVoltage) { - this.batteryVoltage = batteryVoltage; - } - public long getTime() { - return time; - } - - public boolean sameMeasurements(BatteryLogEntry e ){ - return batteryLevel == e.batteryLevel && - batteryVoltage == e.batteryVoltage && - status == e.status && - plugged == e.plugged; - } - - public String getMessage(){ - String statusS = ""; - switch(status){ - case BatteryManager.BATTERY_STATUS_CHARGING : statusS = "CHARGING"; - case BatteryManager.BATTERY_STATUS_DISCHARGING: statusS = "DISCHARGING"; - case BatteryManager.BATTERY_STATUS_FULL: statusS = "FULL"; - case BatteryManager.BATTERY_STATUS_NOT_CHARGING: statusS = "NOT_CHARGING"; - } - String pluggedS = ""; - switch(plugged){ - case BatteryManager.BATTERY_PLUGGED_AC: pluggedS = "PLUGGED_AC"; - case BatteryManager.BATTERY_PLUGGED_USB: pluggedS = "PLUGGED_USB"; - } - CharSequence timeS = DateFormat.format("MM/dd/yy k:mm",this.time); - return MessageFormat.format("{0} : battery ({1}), voltage ({2}), plugged ({3}), status ({4})", - timeS, batteryLevel, batteryVoltage, pluggedS, statusS); - } - - @Override - public String toString() { - return getMessage(); - } - - } - - public static class BatteryLogBinder extends Binder { - - private List entries = new ArrayList(); - - - public boolean addEntry(BatteryLogEntry e){ - if(entries.isEmpty()){ - entries.add(e); - return true; - } - BatteryLogEntry last = entries.get(entries.size() - 1); - if(!last.sameMeasurements(e) || e.getTime() - last.getTime() > 60000){ - entries.add(e); - return true; - } - return false; - } - - - public void clearEntries(){ - entries.clear(); - } - public List getEntries() { - return entries; - } - } - - - @Override - public void onCreate() { - super.onCreate(); - - batteryStatusReceiver = new BatteryStatusReceiver(this); - registerReceiver(batteryStatusReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); - - receiveMessage(100, 0, 0, 1); - } - - public void receiveMessage(int voltage, int level, int plugged, int status){ - BatteryLogEntry entry = new BatteryLogEntry(); - entry.setBatteryVoltage(voltage); - entry.setBatteryLevel(level); - entry.setPlugged(plugged); - entry.setStatus(status); - binder.addEntry(entry); - } - - - @Override - public void onLowMemory() { - super.onLowMemory(); - } - - @Override - public void onDestroy() { - super.onDestroy(); - unregisterReceiver(batteryStatusReceiver); - } - -} diff --git a/BatteryLifeLog/src/com/anvisics/battery/BatteryStatusReceiver.java b/BatteryLifeLog/src/com/anvisics/battery/BatteryStatusReceiver.java deleted file mode 100644 index ef132110d5..0000000000 --- a/BatteryLifeLog/src/com/anvisics/battery/BatteryStatusReceiver.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.anvisics.battery; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; - -public class BatteryStatusReceiver extends BroadcastReceiver { - - private final BatteryLogService service; - - public BatteryStatusReceiver(BatteryLogService service){ - this.service = service; - } - - @Override - public void onReceive(Context context, Intent intent) { - service.receiveMessage(intent.getIntExtra("voltage", -1), intent.getIntExtra("level", -1), - intent.getIntExtra("plugged", -1), intent.getIntExtra("status", -1)); - - } - -} diff --git a/BatteryLifeLog/src/com/anvisics/battery/BatteryViewActivity.java b/BatteryLifeLog/src/com/anvisics/battery/BatteryViewActivity.java deleted file mode 100644 index 7dee2d865f..0000000000 --- a/BatteryLifeLog/src/com/anvisics/battery/BatteryViewActivity.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.anvisics.battery; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.List; - -import android.app.Activity; -import android.content.ComponentName; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.Bundle; -import android.os.Environment; -import android.os.IBinder; -import android.util.Log; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.GridView; - -import com.anvisics.battery.BatteryLogService.BatteryLogBinder; -import com.anvisics.battery.BatteryLogService.BatteryLogEntry; - -public class BatteryViewActivity extends Activity { - private Button startServiceButton; - private Button stopServiceButton; - private GridView gridView; - - - private final Intent serviceIntent = new Intent("com.anvisics.BatteryLogService"); - - ServiceConnection serviceConnection = null; - private ArrayAdapter gridViewAdapter; - private BatteryLogBinder binder = null; - - private class MyServiceConnection implements ServiceConnection { - - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - if(service instanceof BatteryLogBinder){ - gridViewAdapter.clear(); - binder = (BatteryLogBinder) service; - List entries = ((BatteryLogBinder) service).getEntries(); - for(int i = entries.size() - 1; i>=0; i--){ - gridViewAdapter.add(entries.get(i)); - } - } - } - - - @Override - public void onServiceDisconnected(ComponentName name) { - gridViewAdapter.clear(); - binder = null; - } - - }; - - - /** Called when the activity is first created. */ - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.main); - - - startServiceButton = (Button)findViewById(R.id.Button01); - stopServiceButton = (Button)findViewById(R.id.Button02); - - - - gridView = (GridView) findViewById(R.id.GridView01); - - gridView.setNumColumns(1); - gridView.setVerticalSpacing(3); - gridViewAdapter = new ArrayAdapter(getWindow().getContext(), R.layout.mytext); - gridView.setAdapter(gridViewAdapter); - - - startServiceButton.setOnClickListener(new OnClickListener(){ - @Override - public void onClick(View v) { - ComponentName name = getWindow().getContext().startService(serviceIntent); - if(name != null){ - stopServiceButton.setEnabled(true); - startServiceButton.setEnabled(false); - } - } - }); - - stopServiceButton.setOnClickListener(new OnClickListener(){ - @Override - public void onClick(View v) { - boolean stopService = getWindow().getContext().stopService(serviceIntent); - if(stopService){ - stopServiceButton.setEnabled(false); - startServiceButton.setEnabled(true); - } - } - }); - - ComponentName componentName = getWindow().getContext().startService(serviceIntent); - startServiceButton.setEnabled(componentName == null); - stopServiceButton.setEnabled(componentName != null); - serviceConnection = new MyServiceConnection(); - - - getWindow().getContext().bindService(serviceIntent, serviceConnection, 0); - - } - - public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.main_menu, menu); - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if(item.getItemId() == R.id.Clear){ - if(binder != null){ - binder.clearEntries(); - gridViewAdapter.clear(); - } - return true; - } else if (item.getItemId() == R.id.Export) { - if (binder == null) { - return true; - } - File directory = Environment.getExternalStorageDirectory(); - if (directory.canWrite()) { - File f = new File(directory, "BatteryLog.txt"); - int i = 1; - while (f.exists()) { - f = new File(directory, "BatteryLog" + (++i) + ".txt"); - } - - try { - BufferedWriter writer = new BufferedWriter( - new FileWriter(f)); - List entries = binder.getEntries(); - for (i = entries.size() - 1; i >= 0; i--) { - writer.write(entries.get(i).toString()); - } - writer.close(); - binder.clearEntries(); - gridViewAdapter.clear(); - } catch (IOException e) { - Log.e("batteryLog", "Can't export file", e); - } - } - } else if(item.getItemId() == R.id.Exit){ - finish(); - return true; - } - return super.onOptionsItemSelected(item); - } - - - - - @Override - protected void onDestroy() { - super.onDestroy(); - if(serviceConnection != null){ - getWindow().getContext().unbindService(serviceConnection); - serviceConnection = null; - } - } - - -} \ No newline at end of file diff --git a/build-scripts/jenkins/GenerateIndexes/config.xml b/build-scripts/jenkins/GenerateIndexes/config.xml deleted file mode 100644 index ca54eed1b8..0000000000 --- a/build-scripts/jenkins/GenerateIndexes/config.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - 1.400 - 1 - NORMAL - true - - - true - false - - ${ITEM_ROOTDIR}/workspace - ${ITEM_ROOTDIR}/builds - - false - - - - - - - 5 - 0 - - - - All - false - false - - - - All - 0 - - - -