/**
* Global Sensor Networks (GSN) Source Code
* Copyright (c) 2006-2014, Ecole Polytechnique Federale de Lausanne (EPFL)
* <p/>
* This file is part of GSN.
* <p/>
* GSN 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.
* <p/>
* GSN 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.
* <p/>
* You should have received a copy of the GNU General Public License
* along with GSN. If not, see <http://www.gnu.org/licenses/>.
* <p/>
* File: gsn-tiny/src/tinygsn/model/vsensor/BridgeVirtualSensor.java
*
* @author Do Ngoc Hoan
*/
package tinygsn.model.vsensor;
import org.epfl.locationprivacy.util.Utils;
import tinygsn.beans.StaticData;
import tinygsn.beans.StreamElement;
import static android.os.Debug.startMethodTracing;
import static android.os.Debug.stopMethodTracing;
public class BridgeVirtualSensor extends AbstractVirtualSensor {
private static final long serialVersionUID = -7656375392762513783L;
private String LOGTAG = "BridgeVirtualSensor";
@Override
public boolean initialize() {
return false;
}
@Override
public void dispose() {
}
@Override
public void dataAvailable(String inputStreamName, StreamElement streamElement) {
/*if ((boolean) Utils.getBuildConfigValue(StaticData.globalContext, "PERFORMANCE")) {
startMethodTracing("Android/data/tinygsn.gui.android/" + LOGTAG + "_" + inputStreamName + "_" + System.currentTimeMillis());
}
log("dataAvailable_" + LOGTAG + "_" + inputStreamName, "===========================================");
log("dataAvailable_" + LOGTAG + "_" + inputStreamName, "Starting to process data in dataAvailable");
long startLogTime = System.currentTimeMillis();
*/
StreamElement anonymizedData = super.anonymizeData(inputStreamName, streamElement);
/*
long endLogTime = System.currentTimeMillis();
log("dataAvailable_" + LOGTAG + "_" + inputStreamName, "Total Time to process data in dataAvailable() (without dataProduced()) : " + (endLogTime - startLogTime) + " ms.");
*/
dataProduced(anonymizedData);
/*
if ((boolean) Utils.getBuildConfigValue(StaticData.globalContext, "PERFORMANCE") || (boolean) Utils.getBuildConfigValue(StaticData.globalContext, "GPSPERFORMANCE")) {
stopMethodTracing();
}*/
}
}