incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [2/2] android commit: CB-1573: Can we remove framework/src/org/apache/cordova/TempListener.java
Date Tue, 02 Oct 2012 18:41:15 GMT
CB-1573: Can we remove framework/src/org/apache/cordova/TempListener.java


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/8d7b85b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/8d7b85b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/8d7b85b2

Branch: refs/heads/master
Commit: 8d7b85b26ad3d9643b0b721d0ac1095fd9e0eebb
Parents: 9c6c782
Author: Simon MacDonald <simon.macdonald@gmail.com>
Authored: Tue Oct 2 14:38:02 2012 -0400
Committer: Simon MacDonald <simon.macdonald@gmail.com>
Committed: Tue Oct 2 14:40:24 2012 -0400

----------------------------------------------------------------------
 framework/res/xml/config.xml                       |    1 -
 framework/src/org/apache/cordova/TempListener.java |  119 ---------------
 2 files changed, 0 insertions(+), 120 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/8d7b85b2/framework/res/xml/config.xml
----------------------------------------------------------------------
diff --git a/framework/res/xml/config.xml b/framework/res/xml/config.xml
index 1117f8d..a2d6958 100644
--- a/framework/res/xml/config.xml
+++ b/framework/res/xml/config.xml
@@ -45,7 +45,6 @@
     <plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
     <plugin name="Notification" value="org.apache.cordova.Notification"/>
     <plugin name="Storage" value="org.apache.cordova.Storage"/>
-    <plugin name="Temperature" value="org.apache.cordova.TempListener"/>
     <plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
     <plugin name="Capture" value="org.apache.cordova.Capture"/>
     <plugin name="Battery" value="org.apache.cordova.BatteryListener"/>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/8d7b85b2/framework/src/org/apache/cordova/TempListener.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/TempListener.java b/framework/src/org/apache/cordova/TempListener.java
deleted file mode 100755
index 5b59404..0000000
--- a/framework/src/org/apache/cordova/TempListener.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package org.apache.cordova;
-
-import java.util.List;
-
-import org.apache.cordova.api.CordovaInterface;
-import org.apache.cordova.api.Plugin;
-import org.apache.cordova.api.PluginResult;
-import org.json.JSONArray;
-
-import android.hardware.Sensor;
-import android.hardware.SensorEvent;
-import android.hardware.SensorEventListener;
-import android.hardware.SensorManager;
-import android.content.Context;
-
-public class TempListener extends Plugin implements SensorEventListener {
-
-    Sensor mSensor;
-    private SensorManager sensorManager;
-
-    /**
-     * Constructor.
-     */
-    public TempListener() {
-    }
-
-    /**
-     * Sets the context of the Command. This can then be used to do things like
-     * get file paths associated with the Activity.
-     *
-     * @param cordova The context of the main Activity.
-     */
-    public void setContext(CordovaInterface cordova) {
-        super.setContext(cordova);
-        this.sensorManager = (SensorManager) cordova.getActivity().getSystemService(Context.SENSOR_SERVICE);
-    }
-
-    /**
-     * Executes the request and returns PluginResult.
-     * 
-     * @param action 		The action to execute.
-     * @param args 			JSONArry of arguments for the plugin.
-     * @param callbackId	The callback id used when calling back into JavaScript.
-     * @return 				A PluginResult object with a status and message.
-     */
-    public PluginResult execute(String action, JSONArray args, String callbackId) {
-        PluginResult.Status status = PluginResult.Status.OK;
-        String result = "";
-
-        if (action.equals("start")) {
-            this.start();
-        }
-        else if (action.equals("stop")) {
-            this.stop();
-        }
-        return new PluginResult(status, result);
-    }
-
-    /**
-     * Called by AccelBroker when listener is to be shut down.
-     * Stop listener.
-     */
-    public void onDestroy() {
-        this.stop();
-    }
-
-    /**
-     * Called on navigation.
-     */
-    public void onReset() {
-        this.stop();
-    }
-
-    //--------------------------------------------------------------------------
-    // LOCAL METHODS
-    //--------------------------------------------------------------------------
-
-    public void start() {
-        @SuppressWarnings("deprecation")
-        List<Sensor> list = this.sensorManager.getSensorList(Sensor.TYPE_TEMPERATURE);
-        if (list.size() > 0) {
-            this.mSensor = list.get(0);
-            this.sensorManager.registerListener(this, this.mSensor, SensorManager.SENSOR_DELAY_NORMAL);
-        }
-    }
-
-    public void stop() {
-        this.sensorManager.unregisterListener(this);
-    }
-
-    public void onAccuracyChanged(Sensor sensor, int accuracy) {
-        // TODO Auto-generated method stub
-    }
-
-    public void onSensorChanged(SensorEvent event) {
-        // We want to know what temp this is.
-        float temp = event.values[0];
-        this.sendJavascript("gotTemp(" + temp + ");");
-    }
-
-}


Mime
View raw message