Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit dd56456c9780576206ae45e55904bdcc2d87cc1b @msg555 committed Oct 7, 2011
Showing with 11,141 additions and 0 deletions.
  1. +95 −0 AndroidManifest.xml
  2. +16 −0 LICENCE
  3. +224 −0 LogUploaderUmich.java
  4. +39 −0 Makefile
  5. BIN android-9.jar
  6. BIN debug.keystore
  7. +11 −0 default.properties
  8. +9 −0 jni/Android.mk
  9. +81 −0 jni/bindings.cpp
  10. BIN libs/achartengine-0.7.0.jar
  11. BIN libs/armeabi/bindings.so
  12. BIN obj/local/armeabi/bindings.so
  13. +1 −0 obj/local/armeabi/libstdc++.a
  14. BIN obj/local/armeabi/objs/bindings-jni/bindings.o
  15. +182 −0 obj/local/armeabi/objs/bindings-jni/bindings.o.d
  16. BIN obj/local/armeabi/objs/bindings/bindings.o
  17. +182 −0 obj/local/armeabi/objs/bindings/bindings.o.d
  18. BIN res/drawable/background.png
  19. BIN res/drawable/help.png
  20. BIN res/drawable/icon.png
  21. +12 −0 res/drawable/level.xml
  22. BIN res/drawable/level_1.png
  23. BIN res/drawable/level_2.png
  24. BIN res/drawable/level_3.png
  25. BIN res/drawable/level_4.png
  26. BIN res/drawable/level_5.png
  27. BIN res/drawable/level_6.png
  28. BIN res/drawable/level_7.png
  29. BIN res/drawable/level_8.png
  30. BIN res/drawable/level_9.png
  31. BIN res/drawable/line.png
  32. BIN res/drawable/power_off.png
  33. BIN res/drawable/power_on.png
  34. +16 −0 res/drawable/time.xml
  35. BIN res/drawable/time_0.png
  36. BIN res/drawable/time_1.png
  37. BIN res/drawable/time_10.png
  38. BIN res/drawable/time_11.png
  39. BIN res/drawable/time_12.png
  40. BIN res/drawable/time_2.png
  41. BIN res/drawable/time_3.png
  42. BIN res/drawable/time_4.png
  43. BIN res/drawable/time_5.png
  44. BIN res/drawable/time_6.png
  45. BIN res/drawable/time_7.png
  46. BIN res/drawable/time_8.png
  47. BIN res/drawable/time_9.png
  48. BIN res/drawable/widget_bg.png
  49. +68 −0 res/layout/help.xml
  50. +78 −0 res/layout/main.xml
  51. +42 −0 res/layout/misc_item_layout.xml
  52. +19 −0 res/layout/misc_layout.xml
  53. +21 −0 res/layout/power_tabs.xml
  54. +33 −0 res/layout/widget_configure.xml
  55. +27 −0 res/layout/widget_item_layout.xml
  56. +42 −0 res/layout/widget_layout.xml
  57. +30 −0 res/values/arrays.xml
  58. +90 −0 res/values/strings.xml
  59. +12 −0 res/xml/preferences.xml
  60. +15 −0 res/xml/viewer_preferences.xml
  61. +8 −0 res/xml/widget_info.xml
  62. +70 −0 src/edu/umich/PowerTutor/PowerNotifications.aidl
  63. +188 −0 src/edu/umich/PowerTutor/components/Audio.java
  64. +358 −0 src/edu/umich/PowerTutor/components/CPU.java
  65. +456 −0 src/edu/umich/PowerTutor/components/GPS.java
  66. +179 −0 src/edu/umich/PowerTutor/components/LCD.java
  67. +311 −0 src/edu/umich/PowerTutor/components/OLED.java
  68. +142 −0 src/edu/umich/PowerTutor/components/PowerComponent.java
  69. +217 −0 src/edu/umich/PowerTutor/components/Sensors.java
  70. +398 −0 src/edu/umich/PowerTutor/components/Threeg.java
  71. +418 −0 src/edu/umich/PowerTutor/components/Wifi.java
  72. +216 −0 src/edu/umich/PowerTutor/phone/DreamConstants.java
  73. +163 −0 src/edu/umich/PowerTutor/phone/DreamPowerCalculator.java
  74. +160 −0 src/edu/umich/PowerTutor/phone/PassionConstants.java
  75. +56 −0 src/edu/umich/PowerTutor/phone/PassionPowerCalculator.java
  76. +150 −0 src/edu/umich/PowerTutor/phone/PhoneConstants.java
  77. +48 −0 src/edu/umich/PowerTutor/phone/PhonePowerCalculator.java
  78. +204 −0 src/edu/umich/PowerTutor/phone/PhoneSelector.java
  79. +26 −0 src/edu/umich/PowerTutor/phone/PowerFunction.java
  80. +123 −0 src/edu/umich/PowerTutor/phone/SapphireConstants.java
  81. +42 −0 src/edu/umich/PowerTutor/phone/SapphirePowerCalculator.java
  82. +79 −0 src/edu/umich/PowerTutor/service/ICounterService.aidl
  83. +76 −0 src/edu/umich/PowerTutor/service/IterationData.java
  84. +68 −0 src/edu/umich/PowerTutor/service/LogUploader.java
  85. +48 −0 src/edu/umich/PowerTutor/service/PowerData.java
  86. +580 −0 src/edu/umich/PowerTutor/service/PowerEstimator.java
  87. +394 −0 src/edu/umich/PowerTutor/service/UMLoggerService.java
  88. +65 −0 src/edu/umich/PowerTutor/service/UidInfo.java
  89. +32 −0 src/edu/umich/PowerTutor/ui/EditPreferences.java
  90. +49 −0 src/edu/umich/PowerTutor/ui/Help.java
  91. +478 −0 src/edu/umich/PowerTutor/ui/MiscView.java
  92. +295 −0 src/edu/umich/PowerTutor/ui/PowerPie.java
  93. +63 −0 src/edu/umich/PowerTutor/ui/PowerTabs.java
  94. +428 −0 src/edu/umich/PowerTutor/ui/PowerTop.java
  95. +343 −0 src/edu/umich/PowerTutor/ui/PowerViewer.java
  96. +41 −0 src/edu/umich/PowerTutor/ui/StartupReceiver.java
  97. +355 −0 src/edu/umich/PowerTutor/ui/UMLogger.java
  98. +32 −0 src/edu/umich/PowerTutor/ui/ViewerPreferences.java
  99. +214 −0 src/edu/umich/PowerTutor/util/BatteryStats.java
  100. +118 −0 src/edu/umich/PowerTutor/util/Counter.java
  101. +114 −0 src/edu/umich/PowerTutor/util/ForegroundDetector.java
  102. +41 −0 src/edu/umich/PowerTutor/util/HexEncode.java
  103. +136 −0 src/edu/umich/PowerTutor/util/HistoryBuffer.java
  104. +45 −0 src/edu/umich/PowerTutor/util/NativeLoader.java
  105. +354 −0 src/edu/umich/PowerTutor/util/NotificationService.java
  106. +52 −0 src/edu/umich/PowerTutor/util/Recycler.java
  107. +573 −0 src/edu/umich/PowerTutor/util/SystemInfo.java
  108. +163 −0 src/edu/umich/PowerTutor/widget/Configure.java
  109. +341 −0 src/edu/umich/PowerTutor/widget/DataSource.java
  110. +134 −0 src/edu/umich/PowerTutor/widget/DataSourceConfigure.java
  111. +152 −0 src/edu/umich/PowerTutor/widget/PowerWidget.java
95 AndroidManifest.xml
@@ -0,0 +1,95 @@
+<?xml version="1.1" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="edu.umich.PowerTutor"
+ android:versionCode="13" android:versionName="1.4">
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".ui.UMLogger"
+ android:label="@string/app_name"
+ android:screenOrientation="portrait" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.Help" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.PowerViewer" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.PowerTop"
+ android:label="Power Top" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.PowerPie" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.MiscView" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.PowerTabs"
+ android:theme="@android:style/Theme.NoTitleBar">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.EditPreferences"
+ android:label="PowerTutor Options">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ui.ViewerPreferences"
+ android:label="PowerTutor History Options">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".widget.Configure"
+ android:label="Configure PowerTutor Widget" >
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".widget.DataSourceConfigure"
+ android:label="Configure Data Source">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ </intent-filter>
+ </activity>
+ <receiver android:name=".ui.StartupReceiver">
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ <category android:name="android.intent.category.HOME" />
+ </intent-filter>
+ </receiver>
+ <service android:name=".service.UMLoggerService"></service>
+ <receiver android:name=".widget.PowerWidget" >
+ <intent-filter>
+ <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+ </intent-filter>
+ <meta-data android:name="android.appwidget.provider"
+ android:resource="@xml/widget_info" />
+ </receiver>
+ </application>
+
+
+
+ <uses-sdk android:minSdkVersion="3" />
+ <uses-permission android:name="android.permission.INTERNET" />
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+ <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+ <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+</manifest>
16 LICENCE
@@ -0,0 +1,16 @@
+Copyright (C) 2011 The University of Michigan
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Please send inquiries to powertutor@umich.edu
224 LogUploaderUmich.java
@@ -0,0 +1,224 @@
+package edu.umich.PowerTutor.service;
+
+import edu.umich.PowerTutor.ui.UMLogger;
+
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.NetworkInfo;
+import android.os.Build;
+import android.os.PowerManager;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.math.BigInteger;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketTimeoutException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.zip.DeflaterOutputStream;
+
+/* This class is responsible for all of the policy decisions on when to actually
+ * send log information back to our log collecting servers and is also
+ * responsible for actually sending the data should it decide that it is
+ * appropriate.
+ */
+public class LogUploader {
+ private static final String TAG = "LogUploader";
+
+ public static final String UPLOAD_FILE = "PowerTrace_Upload.log";
+
+ private static final long NONE_LOG_LENGTH = 1 << 20; // 1 MiB
+ private static final long WIFI_LOG_LENGTH = 1 << 17; // 128 KiB
+ private static final long THREEG_LOG_LENGTH = 1 << 19; // 512 KiB
+
+ private static final int CONNECTION_NONE = 0;
+ private static final int CONNECTION_WIFI = 1;
+ private static final int CONNECTION_3G = 2;
+
+ private boolean plugged;
+
+ private File logFile;
+ private ConnectivityManager connectivityManager;
+ private TelephonyManager telephonyManager;
+
+ private Thread uploadThread;
+
+ public LogUploader(Context context) {
+ telephonyManager = (TelephonyManager)context.getSystemService(
+ Context.TELEPHONY_SERVICE);
+ connectivityManager = (ConnectivityManager)context.getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ logFile = context.getFileStreamPath(UPLOAD_FILE);
+ }
+
+ public synchronized boolean shouldUpload() {
+ switch(connectionAvailable()) {
+ case CONNECTION_WIFI:
+ return plugged && logFile.length() > WIFI_LOG_LENGTH;
+ case CONNECTION_3G:
+ return plugged && logFile.length() > THREEG_LOG_LENGTH;
+ default: // CONNECTION_NONE
+ return logFile.length() > NONE_LOG_LENGTH;
+ }
+ }
+
+ public synchronized void plug(boolean plugged) {
+ this.plugged = plugged;
+ }
+
+ private int connectionAvailable() {
+ /* TODO: Maybe we should only send data when the device is plugged in.
+ */
+ NetworkInfo info = connectivityManager.getActiveNetworkInfo();
+ if(info == null || !connectivityManager.getBackgroundDataSetting()) {
+ return CONNECTION_NONE;
+ }
+ int netType = info.getType();
+ int netSubtype = info.getSubtype();
+ if (netType == ConnectivityManager.TYPE_WIFI) {
+ return info.isConnected() ? CONNECTION_WIFI : CONNECTION_NONE;
+ } else if (netType == ConnectivityManager.TYPE_MOBILE
+ && netSubtype == TelephonyManager.NETWORK_TYPE_UMTS
+ && !telephonyManager.isNetworkRoaming()) {
+ return info.isConnected() ? CONNECTION_3G : CONNECTION_NONE;
+ }
+ return CONNECTION_NONE;
+ }
+
+ public void upload(String origFile) {
+ if(new File(origFile).renameTo(logFile)) {
+ interrupt();
+ uploadThread = new Thread() {
+ public void run() {
+ long runID = System.currentTimeMillis();
+ for(int iter = 1; !interrupted(); iter++) {
+ if(send(runID)) {
+ break;
+ }
+ if(iter > 12) iter = 12; // The max wait is a little over 1 hour.
+ Log.i(TAG, "Failed to send log. Will try again in " + (1 << iter) +
+ " seconds");
+ try {
+ do {
+ sleep(1000 * (1 << iter)); // Sleep for 2^iter seconds.
+ } while(connectionAvailable() == CONNECTION_NONE);
+ } catch(InterruptedException e) {
+ break;
+ }
+ }
+ }
+ };
+ uploadThread.start();
+ } else {
+ Log.w(TAG, "Failed to move log file before sending");
+ }
+ }
+
+ public boolean isUploading() {
+ return uploadThread != null && uploadThread.isAlive();
+ }
+
+ public void interrupt() {
+ if(uploadThread != null) {
+ uploadThread.interrupt();
+ }
+ }
+
+ public void join() throws InterruptedException {
+ if(uploadThread != null) {
+ uploadThread.join();
+ }
+ }
+
+ public boolean send(long runID) {
+ Log.i(TAG, "Sending log data");
+ Socket s = new Socket();
+ try {
+ s.setSoTimeout(4000);
+ s.connect(new InetSocketAddress(UMLogger.SERVER_IP, UMLogger.SERVER_PORT),
+ 15000);
+ } catch(IOException e) {
+ /* Failed to connect to server. Try again later.
+ */
+ return false;
+ }
+
+ try {
+ BufferedInputStream in = new BufferedInputStream(
+ new FileInputStream(logFile), 1024);
+ BufferedOutputStream sockOut = new BufferedOutputStream(
+ s.getOutputStream(), 1024);
+
+ /* Write the prefix string to the server. */
+ sockOut.write(getPrefix(runID, logFile.length()));
+ sockOut.write(0);
+
+ /* Write the log file to the server. */
+ byte[] buf = new byte[1024];
+ while(true) {
+ int sz = in.read(buf, 0, buf.length);
+ if(sz == -1) break;
+ sockOut.write(buf, 0, sz);
+ }
+ sockOut.flush();
+ int response = s.getInputStream().read();
+ in.close();
+ s.close();
+
+ if(response != 0) {
+ Log.w(TAG, "Log data not accepted by server");
+ }
+ } catch(SocketTimeoutException e) {
+ /* Connection trouble with server. Try again later.
+ */
+ return false;
+ } catch(IOException e) {
+ Log.w(TAG, "Unexpected exception sending log. Dropping log data");
+ e.printStackTrace();
+ }
+ logFile.delete();
+ return true;
+ }
+
+ private byte[] getPrefix(long runID, long payloadLength) {
+ String deviceID = telephonyManager.getDeviceId();
+ return (UMLogger.CURRENT_VERSION + '|' + sanatize(Build.DEVICE) + '|' +
+ getMD5(deviceID) + "|" + payloadLength).getBytes();
+ }
+
+ /* Just strip out any | characters present. Normal DEVICE strings shouldn't
+ * have a | but this string can be set by anyone so we should treat it as
+ * adversarial.
+ */
+ private String sanatize(String s) {
+ StringBuffer buf = new StringBuffer();
+ for(int i = 0; i < s.length(); i++) {
+ if(s.charAt(i) != '|') {
+ buf.append(s.charAt(i));
+ }
+ }
+ return buf.toString();
+ }
+
+ private String getMD5(String s){
+ MessageDigest m = null;
+ try {
+ m = MessageDigest.getInstance("MD5");
+ } catch (NoSuchAlgorithmException e) {
+ // Well this sucks...
+ e.printStackTrace();
+ return "nohash";
+ }
+ m.update(s.getBytes(), 0, s.length());
+ return new BigInteger(1, m.digest()).toString(16);
+ }
+}
39 Makefile
@@ -0,0 +1,39 @@
+all: package
+
+ANDROID_LIB=android-9.jar
+CLASSPATH=$(ANDROID_LIB):libs/achartengine-0.7.0.jar:libs/com.artfulbits.aiCharts.jar
+
+genres:
+ mkdir -p gen bin
+ aapt package -m -J gen -M AndroidManifest.xml -S res -I $(ANDROID_LIB)
+
+aidl:
+ find src/ -type f | \
+ grep '\.aidl$$' | \
+ xargs -n 1 aidl -Isrc -I$(ANDROID_LIB) -ogen
+
+gen: genres aidl
+
+compile: gen
+ mkdir -p bin
+ find src/ gen/ -type f | \
+ grep '\.java$$' | \
+ xargs javac -cp $(CLASSPATH) -d bin
+ ndk-build
+
+dex: compile
+ dx --dex --output=bin/classes.dex bin/ libs/
+
+package: dex
+ aapt package -M AndroidManifest.xml -A assets -S res \
+ -F bin/PowerTutor.apk -I $(ANDROID_LIB)
+ cd bin; zip PowerTutor.apk classes.dex
+ zip bin/PowerTutor.apk -r libs -i \*.so
+ jarsigner -storepass android -keystore debug.keystore \
+ bin/PowerTutor.apk androiddebugkey
+
+install: package
+ adb install bin/PowerTutor.apk
+
+clean:
+ rm -rf bin/ gen/
BIN android-9.jar
Binary file not shown.
BIN debug.keystore
Binary file not shown.
11 default.properties
@@ -0,0 +1,11 @@
+# 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.
+
+# Project target.
+target=android-3
9 jni/Android.mk
@@ -0,0 +1,9 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAN_VARS)
+
+LOCAL_MODULE_FILENAME := bindings
+LOCAL_MODULE := bindings
+LOCAL_SRC_FILES := bindings.cpp
+
+include $(BUILD_SHARED_LIBRARY)
81 jni/bindings.cpp
@@ -0,0 +1,81 @@
+#include <jni.h>
+#include <stdio.h>
+#include <linux/fb.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <stdlib.h>
+
+extern "C" {
+JNIEXPORT jdouble JNICALL
+Java_edu_umich_PowerTutor_components_OLED_getScreenPixPower(
+ JNIEnv * env, jobject thiz, jdouble rcoef, jdouble gcoef,
+ jdouble bcoef, jdouble modul_coef);
+}
+
+#define NUMBER_OF_SAMPLES 500
+
+static int fd = -2;
+static struct fb_fix_screeninfo screeninfo;
+static unsigned char* buf;
+
+static unsigned int samples[NUMBER_OF_SAMPLES];
+
+JNIEXPORT jdouble JNICALL
+Java_edu_umich_PowerTutor_components_OLED_getScreenPixPower(
+ JNIEnv * env, jobject thiz, jdouble rcoef, jdouble gcoef,
+ jdouble bcoef, jdouble modul_coef) {
+ if(fd == -1) {
+ return (jdouble)-1.0;
+ } else if(fd == -2) {
+ fd = open("/dev/graphics/fb0", O_RDWR);
+ if(fd == -1) {
+ fd = open("/dev/fb0", O_RDWR);
+ }
+ if(fd == -1) {
+ return (jdouble)-1.0;
+ }
+ if(ioctl(fd, FBIOGET_FSCREENINFO, &screeninfo)) {
+ close(fd);
+ fd = -1;
+ return (jdouble)-1.0;
+ }
+ buf = (unsigned char*)mmap(NULL, screeninfo.smem_len, PROT_READ,
+ MAP_SHARED, fd, 0);
+ if(buf == (unsigned char*)-1) {
+ close(fd);
+ fd = -1;
+ return (jdouble)-1.0;
+ }
+ int range = screeninfo.smem_len / 12;
+ srand(555);
+ for(int i = 0; i < NUMBER_OF_SAMPLES; i++) {
+ int a = range * i / NUMBER_OF_SAMPLES;
+ int b = range * (i + 1) / NUMBER_OF_SAMPLES;
+ if(b <= a + 1) {
+ samples[i] = a;
+ } else {
+ samples[i] = a + rand() % (b - a);
+ }
+ }
+ }
+ jdouble pixPower = 0.0;
+ for(int i = 0; i < NUMBER_OF_SAMPLES; i++) {
+ int x = 4 * samples[i];
+ int r = buf[x];
+ int g = buf[x + 1];
+ int b = buf[x + 2];
+
+ /* Calculate the power usage of this one pixel if it were at full
+ * brightness. Linearly scale by brightness to get true power
+ * consumption. To calculate whole screen compute average of sampled
+ * region and multiply by number of pixels.
+ */
+ int modul_val = r + g + b;
+ pixPower += rcoef * (r * r) + gcoef * (g * g) + bcoef * (b * b) -
+ modul_coef * (modul_val * modul_val);
+ }
+ return pixPower;
+}
BIN libs/achartengine-0.7.0.jar
Binary file not shown.
BIN libs/armeabi/bindings.so
Binary file not shown.
BIN obj/local/armeabi/bindings.so
Binary file not shown.
1 obj/local/armeabi/libstdc++.a
@@ -0,0 +1 @@
+!<arch>
BIN obj/local/armeabi/objs/bindings-jni/bindings.o
Binary file not shown.
182 obj/local/armeabi/objs/bindings-jni/bindings.o.d
@@ -0,0 +1,182 @@
+/home/msg555/PowerTutor/obj/local/armeabi/objs/bindings-jni/bindings.o: \
+ /home/msg555/PowerTutor/jni/bindings.cpp \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/jni.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdio.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs_elf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdint.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/posix_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stddef.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/compiler.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/posix_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/kernel.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysmacros.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fb.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctls.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/termbits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl_compat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/stat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/time.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/time.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/endian.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/endian.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/unistd.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/select.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/internal_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/syslimits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/string.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/malloc.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/siginfo.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/siginfo.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysconf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/capability.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/pathconf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/page.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdlib.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/alloca.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/strings.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/memory.h
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/jni.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdio.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs_elf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdint.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/posix_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stddef.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/compiler.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/posix_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/kernel.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysmacros.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fb.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctls.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/termbits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl_compat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/stat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/time.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/time.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/endian.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/endian.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/unistd.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/select.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/internal_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/syslimits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/string.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/malloc.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/siginfo.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/siginfo.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysconf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/capability.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/pathconf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/page.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdlib.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/alloca.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/strings.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/memory.h:
BIN obj/local/armeabi/objs/bindings/bindings.o
Binary file not shown.
182 obj/local/armeabi/objs/bindings/bindings.o.d
@@ -0,0 +1,182 @@
+/home/msg555/PowerTutor/obj/local/armeabi/objs/bindings/bindings.o: \
+ /home/msg555/PowerTutor/jni/bindings.cpp \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/jni.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdio.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs_elf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdint.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/posix_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stddef.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/compiler.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/posix_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/kernel.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysmacros.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fb.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/ioctl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctls.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/termbits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl_compat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/stat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/time.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/time.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stat.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/endian.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/endian.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/fcntl.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/unistd.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/select.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/internal_types.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/limits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/syslimits.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/string.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/malloc.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/signal.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/siginfo.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/siginfo.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysconf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/capability.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/pathconf.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/mman.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/page.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdlib.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/alloca.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/strings.h \
+ /home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/memory.h
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/jni.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdio.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/cdefs_elf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdint.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/posix_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stddef.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/compiler.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/posix_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/kernel.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysmacros.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fb.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/ioctl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/ioctls.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/termbits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/ioctl_compat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/stat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/time.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/time.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/stat.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/endian.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/endian.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/fcntl.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/unistd.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/select.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/internal_types.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/machine/limits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/syslimits.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/string.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/malloc.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/signal.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/siginfo.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/siginfo.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/sysconf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/linux/capability.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/pathconf.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/sys/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm-generic/mman.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/asm/page.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/stdlib.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/alloca.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/strings.h:
+
+/home/msg555/android/android-ndk-r6/platforms/android-3/arch-arm/usr/include/memory.h:
BIN res/drawable/background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/help.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 res/drawable/level.xml
@@ -0,0 +1,12 @@
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+ android:id="@+id/l1"
+ <item android:maxLevel="0" android:drawable="@drawable/level_1" />
+ <item android:maxLevel="1" android:drawable="@drawable/level_2" />
+ <item android:maxLevel="2" android:drawable="@drawable/level_3" />
+ <item android:maxLevel="3" android:drawable="@drawable/level_4" />
+ <item android:maxLevel="4" android:drawable="@drawable/level_5" />
+ <item android:maxLevel="5" android:drawable="@drawable/level_6" />
+ <item android:maxLevel="6" android:drawable="@drawable/level_7" />
+ <item android:maxLevel="7" android:drawable="@drawable/level_8" />
+ <item android:maxLevel="8" android:drawable="@drawable/level_9" />
+ </level-list>
BIN res/drawable/level_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_7.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_8.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/level_9.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/line.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/power_off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/power_on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 res/drawable/time.xml
@@ -0,0 +1,16 @@
+<level-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:maxLevel="0" android:drawable="@drawable/level_1" />
+ <item android:maxLevel="1" android:drawable="@drawable/time_0" />
+ <item android:maxLevel="2" android:drawable="@drawable/time_1" />
+ <item android:maxLevel="3" android:drawable="@drawable/time_2" />
+ <item android:maxLevel="4" android:drawable="@drawable/time_3" />
+ <item android:maxLevel="5" android:drawable="@drawable/time_4" />
+ <item android:maxLevel="6" android:drawable="@drawable/time_5" />
+ <item android:maxLevel="7" android:drawable="@drawable/time_6" />
+ <item android:maxLevel="8" android:drawable="@drawable/time_7" />
+ <item android:maxLevel="9" android:drawable="@drawable/time_8" />
+ <item android:maxLevel="10" android:drawable="@drawable/time_9" />
+ <item android:maxLevel="11" android:drawable="@drawable/time_10" />
+ <item android:maxLevel="12" android:drawable="@drawable/time_11" />
+ <item android:maxLevel="13" android:drawable="@drawable/time_12" />
+</level-list>
BIN res/drawable/time_0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_10.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_11.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN res/drawable/time_7.png
Diff not rendered.
BIN res/drawable/time_8.png
Diff not rendered.
BIN res/drawable/time_9.png
Diff not rendered.
BIN res/drawable/widget_bg.png
Diff not rendered.
68 res/layout/help.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/textAreaScroller"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_x="0px"
+ android:layout_y="0px"
+ android:background = "@drawable/help"
+ >
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation ="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <TextView
+ android:id="@+id/s0"
+ android:layout_width="250px"
+ android:layout_height="wrap_content"
+ android:text="@string/help_head"
+ android:textColor="#000000"
+ android:layout_marginLeft = "5px"
+ />
+ <TextView
+ android:id="@+id/s0"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background ="@drawable/icon"
+ />
+ </LinearLayout>
+ <TextView
+ android:id="@+id/s0"
+ android:layout_width="300px"
+ android:layout_height="5px"
+ android:background ="@drawable/line"
+ android:layout_marginLeft = "3px"
+ />
+ <TextView
+ android:id="@+id/s0"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/help_text"
+ android:textColor="#000000"
+ android:textSize="13sp"
+ android:layout_marginLeft = "5px"
+ android:layout_marginRight = "5px"
+ />
+ <TextView
+ android:id="@+id/s1"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/url_1"
+ android:textColor="#000000"
+ android:layout_marginLeft = "5px"
+ />
+ <TextView
+ android:id="@+id/S2"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/url_2"
+ android:textColor="#000000"
+ android:layout_marginLeft = "5px"
+ />
+ </LinearLayout>
+</ScrollView>
78 res/layout/main.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background = "@drawable/background"
+ >
+ <TextView android:id="@+id/s0"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="PowerTutor 1.4"
+ android:gravity="center"
+ android:layout_weight="0.1"
+ android:textSize="16pt"
+ android:textColor="#FFFFFF"
+ />
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="0px"
+ android:layout_weight="1"
+ />
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ >
+ <FrameLayout
+ android:layout_width="0px"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ />
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="0px"
+ android:layout_height="fill_parent"
+ android:layout_weight="3"
+ >
+ <Button android:id="@+id/servicestartbutton"
+ android:layout_weight="0.25"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ />
+ <Button android:id="@+id/appviewerbutton"
+ android:layout_weight="0.25"
+ android:text="Application Viewer"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ />
+ <Button android:id="@+id/sysviewerbutton"
+ android:layout_weight="0.25"
+ android:text="System Viewer"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ />
+ <Button android:id="@+id/helpbutton"
+ android:text = "Help"
+ android:layout_weight="0.25"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:textSize="8pt"
+ />
+ </LinearLayout>
+ <FrameLayout
+ android:layout_width="0px"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ />
+ </LinearLayout>
+ <FrameLayout
+ android:layout_width="fill_parent"
+ android:layout_height="0px"
+ android:layout_weight="1"
+ />
+</LinearLayout>
+
42 res/layout/misc_item_layout.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize">
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_weight="1">
+
+ <TextView android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ <TextView android:id="@+id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/title"
+ android:layout_alignLeft="@id/title"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:maxLines="4" />
+
+ </RelativeLayout>
+
+ <LinearLayout android:id="@+id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:gravity="center_vertical"
+ android:orientation="vertical" />
+
+</LinearLayout>
19 res/layout/misc_layout.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp">
+ <ListView android:id="@id/android:list"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#00FF00"
+ android:layout_weight="1"
+ android:drawSelectorOnTop="false"/>
+ <TextView android:id="@id/android:empty"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:background="#FF0000"
+ android:text="No data"/>
+ </LinearLayout>
21 res/layout/power_tabs.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/tabhost"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="5dp">
+ <TabWidget
+ android:id="@android:id/tabs"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content" />
+ <FrameLayout
+ android:id="@android:id/tabcontent"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="5dp" />
+ </LinearLayout>
+</TabHost>
33 res/layout/widget_configure.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp">
+ <ListView android:id="@+id/list"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:drawSelectorOnTop="false"
+ android:layout_weight="0.15"/>
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.85">
+ <Button android:id="@+id/save_button"
+ android:text="Save"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ />
+ <Button android:id="@+id/cancel_button"
+ android:text="Cancel"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="1"
+ android:gravity="center"
+ />
+ </LinearLayout>
+</LinearLayout>
27 res/layout/widget_item_layout.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_marginLeft="15dip"
+ android:layout_marginRight="6dip"
+ android:layout_marginTop="6dip"
+ android:layout_marginBottom="6dip"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingRight="?android:attr/scrollbarSize">
+ <TextView android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+ <TextView android:id="@+id/summary"
+ android:gravity="center"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/title"
+ android:layout_alignLeft="@id/title"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:maxLines="4" />
+</RelativeLayout>
42 res/layout/widget_layout.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="14dp"
+ android:paddingRight="14dp"
+ android:paddingTop="17dp"
+ android:paddingBottom="17dp"
+ android:background="@drawable/widget_bg"
+ >
+ <ImageView android:id="@+id/power_button"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.25"
+ android:paddingRight="3dp"
+ android:src="@drawable/power_off"
+ android:clickable="true"
+ android:scaleType="centerInside"
+ />
+ <TextView android:id="@+id/text_minute"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.25"
+ android:paddingRight="3dp"
+ android:gravity="center"
+ />
+ <TextView android:id="@+id/text_hour"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.25"
+ android:paddingRight="3dp"
+ android:gravity="center"
+ />
+ <TextView android:id="@+id/text_day"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_weight="0.25"
+ android:paddingRight="3dp"
+ android:gravity="center"
+ />
+</LinearLayout>
30 res/values/arrays.xml
@@ -0,0 +1,30 @@
+<resources>
+ <string-array name="xaxis">
+ <item>Last 10 seconds</item>
+ <item>Last 30 seconds</item>
+ <item>Last 1 minute</item>
+ <item>Last 2 minutes</item>
+ <item>Last 5 minutes</item>
+ </string-array>
+ <integer-array name="xaxis_secs">
+ <item>10</item>
+ <item>30</item>
+ <item>60</item>
+ <item>120</item>
+ <item>300</item>
+ </integer-array>
+ <string-array name="xaxis_secs_str">
+ <item>10</item>
+ <item>30</item>
+ <item>60</item>
+ <item>120</item>
+ <item>300</item>
+ </string-array>
+ <string-array name="freq">
+ <item>Every 1 second</item>
+ <item>Every 3 seconds</item>
+ <item>Every 6 seconds</item>
+ <item>Every 12 seconds</item>
+ <item>Every 30 seconds</item>
+ </string-array>
+</resources>
90 res/values/strings.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">PowerTutor</string>
+ <string name="running_on_startup">The Power Profiler will now run after your phone starts up.</string>
+ <string name="not_running_on_startup">The Power Profiler will no longer run on when your phone starts up.</string>
+ <string name="stop_sending_text">This application sends data on power utilization and running applications to the PowerTutor team. We gather nothing allowing us to associate the data with you or your phone; a cryptographically secure hash function is used to protect your identity. Pressing \'Stop\' will prevent these data from being sent.</string>
+ <string name="start_sending_text">This application sends data on power utilization and running applications to the PowerTutor team. We gather nothing allowing us to associate the data with you or your phone; a cryptographically secure hash function is used to protect your identity. Pressing \'Start\' will start sending the data from now on.</string>
+ <string name="unknown_phone">Your phone type is not recognized by PowerTutor. You may continue to use PowerTutor however we may not be able to get all of the data for your phone and the power calculations may not be accurate.</string>
+ <string name="term">
+ <p>In this version of PowerTutor the Power Profiler service is run on
+startup and power consumption traces are sent back to the PowerTutor team. This
+helps us identify common power consumption problems for real applications. The
+information will be used to improve PowerTutor and recommend power efficiency
+improvements to other software, with the end goal of increasing your phone\'s
+battery life.\n</p>\n
+ <p>We gather\n
+ - CPU use\n
+ - Amount of WiFi/3G traffic (not its content)\n
+ - Screen brightness\n
+ - GPS activity (but not location)\n
+ - Audio use (on/off, volume)\n
+ - Total power consumption\n
+ - Application resource utilization\n
+ - Phone mode, e.g., airplane mode or call status\n
+</p>
+ <p>\nWe do <b>NOT</b> gather any of your personal data used in applications
+or phone call logs. None of these data will be associate with you or your phone.
+We use a cryptographically secure hash function to protect your identity.\n
+</p>\n
+ <p>PowerTutor will send back traces only when the phone is plugged in and
+will prefer to use Wifi to send back the traces, although your carrier\'s data
+service will be used if Wifi is rarely available. If you would like to disable
+sending traces you can do so in the menu or by turning off background data in
+the android options.
+ </p></string>
+ <string name ="help_head"> <big><b>PowerTutor</b></big> - A real-time system and application power monitor.</string>
+ <string name ="help_text">\n
+ <ul>
+ <li><b>Main control panel</b>\n
+ - Start/stop profiling services. \n
+ - Select <b>Application</b> or <b>System</b> mode to check out power consumption statistics.\n
+ - Menu features:\n
+ \t* Start/stop sending power traces to the PowerTutor team.\n
+ \t* Enable/Disable the profiling service to run on startup.\n
+ \t* Save the current power trace to the sdcard.\n
+ </li>\n
+ <li><b>App View</b>\n
+ - Displays power usage information for all of the apps running on the
+ phone.\n
+ - Press an app row to go to the <i>Graph View</i> for that app\'s power
+ usage.\n
+ - Press a hardware component name in the top tabs to include/exclude it from power
+ calculations.\n
+ - Data interpretation:\n
+ \t* Percentage value: The percentage of energy/average power consumed by the
+ app in system.\n
+ \t* Time value: Time that the app has been actively monitored by PowerTutor.\n
+ - Menu features:\n
+ \t* Change the sort key to one of current power, average power, or total energy usage.\n
+ \t* Change the time span to include the last minute, hour, day, or all time.\n
+ </li>\n
+ <li><b>Graph View</b>\n
+ - Displays app/system power consumption decomposed by hardware component.\n
+ - Use the tabs at the top to move between <i>Chart View</i> and <i>Pie
+ View</i>.\n
+ </li>\n
+ <li><b>Chart View</b>\n
+ - Displays the power usage of different components on the phone in recent
+ history.\n
+ - Scroll to view different component power graphs.\n
+ - Menu features:\n
+ \t* Select \"<i>Set History Size</i>\" to adjust the number of data points
+ displayed.\n
+ \t* Select \"<i>Magnify Recent Data</i>\" to show more recent data points
+ more spread out.\n
+ \t* Select \"<i>Pause</i>\" to freeze the display as is, select resume to
+ continue.\n
+ </li>\n
+ <li><b>Pie View</b>\n
+ - Displays the power usage percentages of the different components.\n
+ - Menu features:\n
+ \t* Change the time span to include the last minute, hour, day, or all time.\n
+ </li>\n
+ </ul>
+ </string>
+
+
+<string name="url_1">For detailed information, please go to: </string>
+<string name="url_2"><a href = "http://powertutor.org">http://powertutor.org</a>.\n</string>
+</resources>
12 res/xml/preferences.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <CheckBoxPreference
+ android:key="runOnStartup"
+ android:title="Run on startup"
+ android:summary="Have the profiling service start when your phone starts" />
+ <CheckBoxPreference
+ android:key="sendPermission"
+ android:title="Send logs"
+ android:summary="Send back power traces to the PowerTutor team" />
+</PreferenceScreen>
15 res/xml/viewer_preferences.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android">
+ <CheckBoxPreference
+ android:key="showTotalPower"
+ android:title="Total power"
+ android:summary="Show total power consumption" />
+ <ListPreference android:key="viewNumValues_s"
+ android:title="Set history size"
+ android:summary="Change how many data points are displayed"
+ android:entries="@array/xaxis"
+ android:entryValues="@array/xaxis_secs_str"
+ android:dialogTitle="Set number of data points"
+ android:defaultValue="60" />
+</PreferenceScreen>
8 res/xml/widget_info.xml
@@ -0,0 +1,8 @@
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+ android:configure="edu.umich.PowerTutor.widget.Configure"
+ android:minWidth="294dp"
+ android:minHeight="72dp"
+ android:updatePeriodMillis="0"
+ android:initialLayout="@layout/widget_layout"
+ >
+</appwidget-provider>
70 src/edu/umich/PowerTutor/PowerNotifications.aidl
@@ -0,0 +1,70 @@
+/*
+Copyright (C) 2011 The University of Michigan
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Please send inquiries to powertutor@umich.edu
+*/
+
+package edu.umich.PowerTutor;
+
+interface PowerNotifications {
+ // These are the notifications that are actually supported. The rest have
+ // potential to be supported but aren't needed at the moment so aren't
+ // actually hooked.
+ void noteStartWakelock(int uid, String name, int type);
+ void noteStopWakelock(int uid, String name, int type);
+ void noteStartSensor(int uid, int sensor);
+ void noteStopSensor(int uid, int sensor);
+ void noteStartGps(int uid);
+ void noteStopGps(int uid);
+ void noteScreenBrightness(int brightness);
+ void noteStartMedia(int uid, int id);
+ void noteStopMedia(int uid, int id);
+ void noteVideoSize(int uid, int id, int width, int height);
+ void noteSystemMediaCall(int uid);
+
+ void noteScreenOn();
+ void noteScreenOff();
+ void noteInputEvent();
+ void noteUserActivity(int uid, int event);
+ void notePhoneOn();
+ void notePhoneOff();
+ void notePhoneDataConnectionState(int dataType, boolean hasData);
+ void noteWifiOn(int uid);
+ void noteWifiOff(int uid);
+ void noteWifiRunning();
+ void noteWifiStopped();
+ void noteBluetoothOn();
+ void noteBluetoothOff();
+ void noteFullWifiLockAcquired(int uid);
+ void noteFullWifiLockReleased(int uid);
+ void noteScanWifiLockAcquired(int uid);
+ void noteScanWifiLockReleased(int uid);
+ void noteWifiMulticastEnabled(int uid);
+ void noteWifiMulticastDisabled(int uid);
+ void setOnBattery(boolean onBattery, int level);
+ void recordCurrentLevel(int level);
+ /* Also got rid of the non-notification calls.
+ * byte[] getStatistics();
+ * long getAwakeTimeBattery();
+ * long getAwakeTimePlugged();
+ */
+
+ /* Added functions to the normal IBatteryStats interface. */
+ void noteVideoOn(int uid);
+ void noteVideoOff(int uid);
+ void noteAudioOn(int uid);
+ void noteAudioOff(int uid);
+}
188 src/edu/umich/PowerTutor/components/Audio.java
@@ -0,0 +1,188 @@
+/*
+Copyright (C) 2011 The University of Michigan
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Please send inquiries to powertutor@umich.edu
+*/
+
+package edu.umich.PowerTutor.components;
+
+import edu.umich.PowerTutor.PowerNotifications;
+import edu.umich.PowerTutor.service.IterationData;
+import edu.umich.PowerTutor.service.PowerData;
+import edu.umich.PowerTutor.util.NotificationService;
+import edu.umich.PowerTutor.util.Recycler;
+
+import android.content.Context;
+import android.media.AudioManager;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.TreeSet;
+
+/**This class aims to log the audio device status once per log interval*/
+public class Audio extends PowerComponent {
+ /**This class is the logger data file corresponding to Audio*/
+ public static class AudioData extends PowerData {
+ private static Recycler<AudioData> recycler = new Recycler<AudioData>();
+
+ public static AudioData obtain() {
+ AudioData result = recycler.obtain();
+ if(result != null) return result;
+ return new AudioData();
+ }
+
+ @Override
+ public void recycle() {
+ recycler.recycle(this);
+ }
+
+ public boolean musicOn;
+
+ private AudioData() {
+ }
+
+ public void init(boolean musicOn) {
+ this.musicOn = musicOn;
+ }
+
+ public void writeLogDataInfo(OutputStreamWriter out) throws IOException {
+ out.write("Audio-on " + musicOn + "\n");
+ }
+ }
+
+ private static class MediaData implements Comparable {
+ private static Recycler<MediaData> recycler = new Recycler<MediaData>();
+
+ public static MediaData obtain() {
+ MediaData result = recycler.obtain();
+ if(result != null) return result;
+ return new MediaData();
+ }
+
+ public void recycle() {
+ recycler.recycle(this);
+ }
+
+ public int uid;
+ public int id;
+ public int assignUid;
+
+ public int compareTo(Object obj) {
+ MediaData x = (MediaData)obj;
+ if(uid < x.uid) return -1;
+ if(uid > x.uid) return 1;
+ if(id < x.id) return -1;
+ if(id > x.id) return 1;
+ return 0;
+ }
+
+ public boolean equals(Object obj) {
+ MediaData x = (MediaData)obj;
+ return uid == x.uid && id == x.id;
+ }
+ }
+
+ private AudioManager audioManager;
+ private PowerNotifications audioNotif;
+ private TreeSet<MediaData> uidData;
+
+ public Audio(Context context) {
+ if(NotificationService.available()) {
+ uidData = new TreeSet<MediaData>();
+ audioNotif = new NotificationService.DefaultReceiver() {
+ private int sysUid = -1;
+
+ @Override
+ public void noteSystemMediaCall(int uid) {
+ sysUid = uid;
+ }
+
+ @Override
+ public void noteStartMedia(int uid, int id) {
+ MediaData data = MediaData.obtain();
+ data.uid = uid;
+ data.id = id;
+ if(uid == 1000 && sysUid != -1) {
+ data.assignUid = sysUid;
+ sysUid = -1;
+ } else {
+ data.assignUid = uid;
+ }
+ synchronized(uidData) {
+ if(!uidData.add(data)) {
+ data.recycle();
+ }
+ }
+ }
+
+ @Override
+ public void noteStopMedia(int uid, int id) {
+ MediaData data = MediaData.obtain();
+ data.uid = uid;
+ data.id = id;
+ synchronized(uidData) {
+ uidData.remove(data);
+ }
+ data.recycle();
+ }
+ };
+ NotificationService.addHook(audioNotif);
+ }
+
+ audioManager = (AudioManager)context.getSystemService(
+ Context.AUDIO_SERVICE);
+ }
+
+ @Override
+ protected void onExit() {
+ if(audioNotif != null) {
+ NotificationService.removeHook(audioNotif);
+ }
+ }
+
+ @Override
+ public IterationData calculateIteration(long iteration) {
+ IterationData result = IterationData.obtain();
+ AudioData data = AudioData.obtain();
+ data.init(uidData != null && !uidData.isEmpty() ||
+ audioManager.isMusicActive());
+ result.setPowerData(data);
+
+ if(uidData != null) synchronized(uidData) {
+ int last_uid = -1;
+ for(MediaData dat : uidData) {
+ if(dat.uid != last_uid) {
+ AudioData audioPower = AudioData.obtain();
+ audioPower.init(true);
+ result.addUidPowerData(dat.assignUid, audioPower);
+ }
+ last_uid = dat.uid;
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public boolean hasUidInformation() {
+ return audioNotif != null;
+ }
+
+ @Override
+ public String getComponentName() {
+ return "Audio";
+ }
+}
358 src/edu/umich/PowerTutor/components/CPU.java
@@ -0,0 +1,358 @@
+/*
+Copyright (C) 2011 The University of Michigan
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Please send inquiries to powertutor@umich.edu
+*/
+
+package edu.umich.PowerTutor.components;
+
+import edu.umich.PowerTutor.phone.PhoneConstants;
+import edu.umich.PowerTutor.service.IterationData;
+import edu.umich.PowerTutor.service.PowerData;
+import edu.umich.PowerTutor.util.Recycler;
+import edu.umich.PowerTutor.util.SystemInfo;
+
+import android.util.Log;
+import android.os.Process;
+import android.os.SystemClock;
+import android.util.SparseArray;
+
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+public class CPU extends PowerComponent {
+ public static class CpuData extends PowerData {
+ private static Recycler<CpuData> recycler = new Recycler<CpuData>();
+
+ public static CpuData obtain() {
+ CpuData result = recycler.obtain();
+ if(result != null) return result;
+ return new CpuData();
+ }
+
+ @Override
+ public void recycle() {
+ recycler.recycle(this);
+ }
+
+ public double sysPerc;
+ public double usrPerc;
+ public double freq;
+
+ private CpuData() {
+ }
+
+ public void init(double sysPerc, double usrPerc, double freq) {
+ this.sysPerc = sysPerc;
+ this.usrPerc = usrPerc;
+ this.freq = freq;
+ }
+
+ public void writeLogDataInfo(OutputStreamWriter out) throws IOException {
+ StringBuilder res = new StringBuilder();
+ res.append("CPU-sys ").append((long)Math.round(sysPerc))
+ .append("\nCPU-usr ").append((long)Math.round(usrPerc))
+ .append("\nCPU-freq ").append(freq)
+ .append("\n");
+ out.write(res.toString());
+ }
+ }
+
+ private static final String TAG = "CPU";
+ private static final String CPU_FREQ_FILE = "/proc/cpuinfo";
+ private static final String STAT_FILE = "/proc/stat";
+
+ private CpuStateKeeper cpuState;
+ private SparseArray<CpuStateKeeper> pidStates;
+ private SparseArray<CpuStateKeeper> uidLinks;
+
+ private int[] pids;
+ private long[] statsBuf;
+
+ private PhoneConstants constants;
+
+ public CPU(PhoneConstants constants) {
+ this.constants = constants;
+ cpuState = new CpuStateKeeper(SystemInfo.AID_ALL);
+ pidStates = new SparseArray<CpuStateKeeper>();
+ uidLinks = new SparseArray<CpuStateKeeper>();
+ statsBuf = new long[7];
+ }
+
+ @Override
+ public IterationData calculateIteration(long iteration) {
+ IterationData result = IterationData.obtain();
+
+ SystemInfo sysInfo = SystemInfo.getInstance();
+ double freq = readCpuFreq(sysInfo);
+ if(freq < 0) {
+ Log.w(TAG, "Failed to read cpu frequency");
+ return result;
+ }
+
+ if(!sysInfo.getUsrSysTotalTime(statsBuf)) {
+ Log.w(TAG, "Failed to read cpu times");
+ return result;
+ }
+
+ long usrTime = statsBuf[SystemInfo.INDEX_USER_TIME];
+ long sysTime = statsBuf[SystemInfo.INDEX_SYS_TIME];
+ long totalTime = statsBuf[SystemInfo.INDEX_TOTAL_TIME];
+
+ boolean init = cpuState.isInitialized();
+ cpuState.updateState(usrTime, sysTime, totalTime, iteration);
+
+ if(init) {
+ CpuData data = CpuData.obtain();
+ data.init(cpuState.getUsrPerc(), cpuState.getSysPerc(), freq);
+ result.setPowerData(data);
+ }
+
+ uidLinks.clear();
+ pids = sysInfo.getPids(pids);
+ int pidInd = 0;
+ if(pids != null) for(int pid : pids) {
+ if(pid < 0) {
+ break;
+ }
+
+ CpuStateKeeper pidState;
+ if(pidInd < pidStates.size() && pidStates.keyAt(pidInd) == pid) {
+ pidState = pidStates.valueAt(pidInd);
+ } else {
+ int uid = sysInfo.getUidForPid(pid);
+ if(uid >= 0) {
+ pidState = new CpuStateKeeper(uid);
+ pidStates.put(pid, pidState);
+ } else {
+ /* Assume that this process no longer exists. */
+ continue;
+ }
+ }
+ pidInd++;
+
+ if(!pidState.isStale(iteration)) {
+ /* Nothing much is going on with this pid recently. We'll just
+ * assume that it's not using any of the cpu for this iteration.
+ */
+ pidState.updateIteration(iteration, totalTime);
+ } else if(sysInfo.getPidUsrSysTime(pid, statsBuf)) {
+ usrTime = statsBuf[SystemInfo.INDEX_USER_TIME];
+ sysTime = statsBuf[SystemInfo.INDEX_SYS_TIME];
+
+ init = pidState.isInitialized();
+ pidState.updateState(usrTime, sysTime, totalTime, iteration);
+
+ if(!init) {
+ continue;
+ }
+ }
+
+ CpuStateKeeper linkState = uidLinks.get(pidState.getUid());
+ if(linkState == null) {
+ uidLinks.put(pidState.getUid(), pidState);
+ } else {
+ linkState.absorb(pidState);
+ }
+ }
+
+ /* Remove processes that are no longer active. */
+ for(int i = 0; i < pidStates.size(); i++) {
+ if(!pidStates.valueAt(i).isAlive(iteration)) {
+ pidStates.remove(pidStates.keyAt(i--));
+ }
+ }
+
+ /* Collect the summed uid information. */
+ for(int i = 0; i < uidLinks.size(); i++) {
+ int uid = uidLinks.keyAt(i);
+ CpuStateKeeper linkState = uidLinks.valueAt(i);
+
+ CpuData uidData = CpuData.obtain();
+ predictAppUidState(uidData, linkState.getUsrPerc(),
+ linkState.getSysPerc(), freq);
+ result.addUidPowerData(uid, uidData);
+ }
+
+ return result;
+ }
+
+ /* This is the function that is responsible for predicting the cpu frequency
+ * state of the individual uid as though it were the only thing running. It
+ * simply is finding the lowest frequency that keeps the cpu usage under
+ * 70% assuming there is a linear relationship to the cpu utilization at
+ * different frequencies.
+ */
+ private void predictAppUidState(CpuData uidData, double usrPerc,
+ double sysPerc, double freq) {
+ double[] freqs = constants.cpuFreqs();
+ if(usrPerc + sysPerc < 1e-6) {
+ /* Don't waste time with the binary search if there is no utilization
+ * which will be the case a lot.
+ */
+ uidData.init(sysPerc, usrPerc, freqs[0]);
+ return;
+ }
+ int lo = 0;
+ int hi = freqs.length - 1;
+ double perc = sysPerc + usrPerc;
+ while(lo < hi) {
+ int mid = (lo + hi) / 2;
+ double nperc = perc * freq / freqs[mid];
+ if(nperc < 70) {
+ hi = mid;
+ } else {
+ lo = mid + 1;
+ }
+ }
+ uidData.init(sysPerc * freq / freqs[lo], usrPerc * freq / freqs[lo],
+ freqs[lo]);
+ }
+
+ private static class CpuStateKeeper {