Browse Source

Bug fix relating to turning display off

tags/SensorLogger/0.2.1
Chris Smith 14 years ago
parent
commit
4892564fb0

+ 1
- 1
code/SensorLogger/AndroidManifest.xml View File

@@ -1,6 +1,6 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
-     package="uk.co.md87.android.sensorlogger" android:versionCode="13" android:versionName="0.2.0">
3
+     package="uk.co.md87.android.sensorlogger" android:versionCode="14" android:versionName="0.2.1">
4 4
     <application android:label="Sensor Logger" android:icon="@drawable/icon">
5 5
         <activity android:name=".activities.IntroActivity" android:label="Sensor Logger">
6 6
             <intent-filter>

BIN
code/SensorLogger/dist/SensorLogger.apk View File


+ 23
- 17
code/SensorLogger/src/uk/co/md87/android/sensorlogger/SensorLoggerService.java View File

@@ -33,23 +33,7 @@ public class SensorLoggerService extends Service {
33 33
     private final SensorLoggerBinder.Stub binder = new SensorLoggerBinder.Stub() {
34 34
 
35 35
         public void setState(int newState) throws RemoteException {
36
-            switch (newState) {
37
-                case 1:
38
-                    countdown = 10;
39
-
40
-                    handler.removeCallbacks(countdownTask);
41
-                    handler.postDelayed(countdownTask, 1000);
42
-                    break;
43
-                case 3:
44
-                    startService(new Intent(SensorLoggerService.this, RecorderService.class));
45
-                    break;
46
-                case 8:
47
-                    ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancel(0);
48
-                    stopSelf();
49
-                    break;
50
-            }
51
-
52
-            state = newState;
36
+            doSetState(newState);
53 37
         }
54 38
 
55 39
         public int getCountdownTime() throws RemoteException {
@@ -113,6 +97,8 @@ public class SensorLoggerService extends Service {
113 97
         public void run() {
114 98
             if (--countdown > 0) {
115 99
                 handler.postDelayed(countdownTask, 1000);
100
+            } else {
101
+                doSetState(3);
116 102
             }
117 103
         }
118 104
     };
@@ -164,4 +150,24 @@ public class SensorLoggerService extends Service {
164 150
         return binder;
165 151
     }
166 152
 
153
+    void doSetState(final int newState) {
154
+        switch (newState) {
155
+            case 1:
156
+                countdown = 10;
157
+
158
+                handler.removeCallbacks(countdownTask);
159
+                handler.postDelayed(countdownTask, 1000);
160
+                break;
161
+            case 3:
162
+                startService(new Intent(SensorLoggerService.this, RecorderService.class));
163
+                break;
164
+            case 8:
165
+                ((NotificationManager) getSystemService(NOTIFICATION_SERVICE)).cancel(0);
166
+                stopSelf();
167
+                break;
168
+        }
169
+
170
+        state = newState;
171
+    }
172
+
167 173
 }

+ 0
- 1
code/SensorLogger/src/uk/co/md87/android/sensorlogger/activities/CountdownActivity.java View File

@@ -57,7 +57,6 @@ public class CountdownActivity extends BoundActivity {
57 57
             if (time > 0) {
58 58
                 handler.postDelayed(task, 500);
59 59
             } else {
60
-                service.setState(3);
61 60
                 startActivity(new Intent(this, RecordingActivity.class));
62 61
                 finish();
63 62
             }

+ 1
- 0
website/index.html View File

@@ -45,6 +45,7 @@
45 45
       <p>The application provides a link to a web-based portal where users can see a graph of their uploaded data, and the results of the activity detection algorithm will also be surfaced there.</p>
46 46
       <h4>Changelog</h4>
47 47
       <ul>
48
+       <li><strong>0.2.0 &rarr; 0.2.1</strong>: Bug fix related to turning display off</li>
48 49
        <li><strong>0.1.6 &rarr; 0.2.0</strong>: Near-complete rewrite: much improved UI, classification on device, bug fixes</li>
49 50
        <li><strong>0.1.5 &rarr; 0.1.6</strong>: Fix force close on devices that use MEIDs not IMEI numbers</li>
50 51
        <li><strong>0.1.4 &rarr; 0.1.5</strong>: Make edit boxes single line only</li>

Loading…
Cancel
Save