Skip to content

Commit

Permalink
Fixed timestamp name conflict on wifi probe, ScanResult timestamp ren…
Browse files Browse the repository at this point in the history
…amed to tsf.
  • Loading branch information
alanlgardner committed Apr 6, 2013
1 parent c598fea commit 914d6ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontoptimize
11 changes: 10 additions & 1 deletion src/edu/mit/media/funf/probe/builtin/WifiProbe.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

import edu.mit.media.funf.Schedule;
import edu.mit.media.funf.probe.Probe.Base;
Expand All @@ -52,6 +54,8 @@
@DisplayName("Nearby Wifi Devices Probe")
public class WifiProbe extends Base {

public static final String TSF = "tsf";

private static final String LOCK_KEY = WifiProbe.class.getName();

private WifiManager wifiManager;
Expand All @@ -66,7 +70,12 @@ public void onReceive(Context context, Intent intent) {
if (results != null) {
Gson gson = getGson();
for (ScanResult result : results) {
sendData(gson.toJsonTree(result).getAsJsonObject());
JsonObject data = gson.toJsonTree(result).getAsJsonObject();
if (data.has(TIMESTAMP)) {
JsonElement el = data.remove(TIMESTAMP);
data.add(TSF, el);
}
sendData(data);
}
}
if (getState() == State.RUNNING) {
Expand Down

0 comments on commit 914d6ab

Please sign in to comment.