diff --git a/framework/src/com/phonegap/api/PhonegapActivity.java b/framework/src/com/phonegap/api/PhonegapActivity.java index 9e01f562..d6968c35 100755 --- a/framework/src/com/phonegap/api/PhonegapActivity.java +++ b/framework/src/com/phonegap/api/PhonegapActivity.java @@ -22,5 +22,5 @@ package com.phonegap.api; * The Cordova activity abstract class that is extended by DroidGap. * It is used to isolate plugin development, and remove dependency on entire Cordova library. */ -public abstract class PhonegapActivity extends org.apache.cordova.api.CordovaActivity { +public abstract class PhonegapActivity extends org.apache.cordova.api.CordovaInterface { } diff --git a/framework/src/com/phonegap/api/PluginManager.java b/framework/src/com/phonegap/api/PluginManager.java index 190cc777..65c6f11e 100755 --- a/framework/src/com/phonegap/api/PluginManager.java +++ b/framework/src/com/phonegap/api/PluginManager.java @@ -17,7 +17,7 @@ */ package com.phonegap.api; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import android.webkit.WebView; @@ -29,7 +29,7 @@ import android.webkit.WebView; */ public class PluginManager extends org.apache.cordova.api.PluginManager { - public PluginManager(WebView app, CordovaActivity ctx) { + public PluginManager(WebView app, CordovaInterface ctx) { super(app, ctx); } } diff --git a/framework/src/org/apache/cordova/AccelListener.java b/framework/src/org/apache/cordova/AccelListener.java index 61d7acfc..6eb917f7 100755 --- a/framework/src/org/apache/cordova/AccelListener.java +++ b/framework/src/org/apache/cordova/AccelListener.java @@ -20,7 +20,7 @@ package org.apache.cordova; import java.util.List; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -72,7 +72,7 @@ public class AccelListener extends Plugin implements SensorEventListener { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { super.setContext(ctx); this.sensorManager = (SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE); } diff --git a/framework/src/org/apache/cordova/CompassListener.java b/framework/src/org/apache/cordova/CompassListener.java index f5fa2b6a..9ebe4248 100755 --- a/framework/src/org/apache/cordova/CompassListener.java +++ b/framework/src/org/apache/cordova/CompassListener.java @@ -20,7 +20,7 @@ package org.apache.cordova; import java.util.List; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -69,7 +69,7 @@ public class CompassListener extends Plugin implements SensorEventListener { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { super.setContext(ctx); this.sensorManager = (SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE); } diff --git a/framework/src/org/apache/cordova/Device.java b/framework/src/org/apache/cordova/Device.java index 372402b3..05a53ef4 100644 --- a/framework/src/org/apache/cordova/Device.java +++ b/framework/src/org/apache/cordova/Device.java @@ -21,7 +21,7 @@ package org.apache.cordova; import java.util.TimeZone; import org.apache.cordova.api.LOG; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -56,7 +56,7 @@ public class Device extends Plugin { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { super.setContext(ctx); Device.uuid = getUuid(); this.initTelephonyReceiver(); @@ -125,7 +125,7 @@ public class Device extends Plugin { private void initTelephonyReceiver() { IntentFilter intentFilter = new IntentFilter() ; intentFilter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); - final CordovaActivity myctx = this.ctx; + final CordovaInterface myctx = this.ctx; this.telephonyReceiver = new BroadcastReceiver() { @Override diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 539329e1..61aba0db 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -31,7 +31,7 @@ import org.apache.cordova.PreferenceNode; import org.apache.cordova.PreferenceSet; import org.apache.cordova.api.IPlugin; import org.apache.cordova.api.LOG; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.PluginManager; import org.json.JSONArray; import org.json.JSONException; @@ -159,7 +159,7 @@ import android.widget.LinearLayout; * ... * */ -public class DroidGap extends CordovaActivity { +public class DroidGap extends CordovaInterface { public static String TAG = "DroidGap"; // The webview for our app diff --git a/framework/src/org/apache/cordova/FileUtils.java b/framework/src/org/apache/cordova/FileUtils.java index 03187973..c2bef707 100755 --- a/framework/src/org/apache/cordova/FileUtils.java +++ b/framework/src/org/apache/cordova/FileUtils.java @@ -25,7 +25,7 @@ import java.net.URLDecoder; import java.nio.channels.FileChannel; import org.apache.commons.codec.binary.Base64; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.apache.cordova.file.EncodingException; @@ -1014,7 +1014,7 @@ public class FileUtils extends Plugin { * @param ctx the current applicaiton context * @return the full path to the file */ - protected static String getRealPathFromURI(Uri contentUri, CordovaActivity ctx) { + protected static String getRealPathFromURI(Uri contentUri, CordovaInterface ctx) { String[] proj = { _DATA }; Cursor cursor = ctx.managedQuery(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(_DATA); diff --git a/framework/src/org/apache/cordova/GpsListener.java b/framework/src/org/apache/cordova/GpsListener.java index 165bd1ed..f0006921 100755 --- a/framework/src/org/apache/cordova/GpsListener.java +++ b/framework/src/org/apache/cordova/GpsListener.java @@ -19,7 +19,7 @@ package org.apache.cordova; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import android.content.Context; import android.location.Location; @@ -33,7 +33,7 @@ import android.os.Bundle; */ public class GpsListener implements LocationListener { - private CordovaActivity mCtx; // CordovaActivity object + private CordovaInterface mCtx; // CordovaActivity object private LocationManager mLocMan; // Location manager object private GeoListener owner; // Geolistener object (parent) @@ -49,7 +49,7 @@ public class GpsListener implements LocationListener { * @param interval * @param m */ - public GpsListener(CordovaActivity ctx, int interval, GeoListener m) { + public GpsListener(CordovaInterface ctx, int interval, GeoListener m) { this.owner = m; this.mCtx = ctx; this.mLocMan = (LocationManager) this.mCtx.getSystemService(Context.LOCATION_SERVICE); diff --git a/framework/src/org/apache/cordova/NetworkListener.java b/framework/src/org/apache/cordova/NetworkListener.java index 5dd33424..fd3fbd55 100755 --- a/framework/src/org/apache/cordova/NetworkListener.java +++ b/framework/src/org/apache/cordova/NetworkListener.java @@ -18,7 +18,7 @@ */ package org.apache.cordova; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import android.content.Context; import android.location.Location; @@ -28,7 +28,7 @@ import android.os.Bundle; public class NetworkListener implements LocationListener { - private CordovaActivity mCtx; // CordovaActivity object + private CordovaInterface mCtx; // CordovaActivity object private LocationManager mLocMan; // Location manager object private GeoListener owner; // Geolistener object (parent) @@ -44,7 +44,7 @@ public class NetworkListener implements LocationListener { * @param interval * @param m */ - public NetworkListener(CordovaActivity ctx, int interval, GeoListener m) { + public NetworkListener(CordovaInterface ctx, int interval, GeoListener m) { this.owner = m; this.mCtx = ctx; this.mLocMan = (LocationManager) this.mCtx.getSystemService(Context.LOCATION_SERVICE); diff --git a/framework/src/org/apache/cordova/NetworkManager.java b/framework/src/org/apache/cordova/NetworkManager.java index 8159e636..808dac13 100755 --- a/framework/src/org/apache/cordova/NetworkManager.java +++ b/framework/src/org/apache/cordova/NetworkManager.java @@ -18,7 +18,7 @@ */ package org.apache.cordova; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -87,7 +87,7 @@ public class NetworkManager extends Plugin { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { super.setContext(ctx); this.sockMan = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); this.connectionCallbackId = null; diff --git a/framework/src/org/apache/cordova/Notification.java b/framework/src/org/apache/cordova/Notification.java index 9605ea65..535142b9 100755 --- a/framework/src/org/apache/cordova/Notification.java +++ b/framework/src/org/apache/cordova/Notification.java @@ -18,7 +18,7 @@ */ package org.apache.cordova; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -184,7 +184,7 @@ public class Notification extends Plugin { */ public synchronized void alert(final String message, final String title, final String buttonLabel, final String callbackId) { - final CordovaActivity ctx = this.ctx; + final CordovaInterface ctx = this.ctx; final Notification notification = this; Runnable runnable = new Runnable() { @@ -220,7 +220,7 @@ public class Notification extends Plugin { */ public synchronized void confirm(final String message, final String title, String buttonLabels, final String callbackId) { - final CordovaActivity ctx = this.ctx; + final CordovaInterface ctx = this.ctx; final Notification notification = this; final String[] fButtons = buttonLabels.split(","); @@ -284,7 +284,7 @@ public class Notification extends Plugin { this.spinnerDialog = null; } final Notification notification = this; - final CordovaActivity ctx = this.ctx; + final CordovaInterface ctx = this.ctx; Runnable runnable = new Runnable() { public void run() { notification.spinnerDialog = ProgressDialog.show(ctx, title , message, true, true, @@ -320,7 +320,7 @@ public class Notification extends Plugin { this.progressDialog = null; } final Notification notification = this; - final CordovaActivity ctx = this.ctx; + final CordovaInterface ctx = this.ctx; Runnable runnable = new Runnable() { public void run() { notification.progressDialog = new ProgressDialog(ctx); diff --git a/framework/src/org/apache/cordova/TempListener.java b/framework/src/org/apache/cordova/TempListener.java index 85831da2..93a5f821 100755 --- a/framework/src/org/apache/cordova/TempListener.java +++ b/framework/src/org/apache/cordova/TempListener.java @@ -20,7 +20,7 @@ package org.apache.cordova; import java.util.List; -import org.apache.cordova.api.CordovaActivity; +import org.apache.cordova.api.CordovaInterface; import org.apache.cordova.api.Plugin; import org.apache.cordova.api.PluginResult; import org.json.JSONArray; @@ -49,7 +49,7 @@ public class TempListener extends Plugin implements SensorEventListener { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { super.setContext(ctx); this.sensorManager = (SensorManager) ctx.getSystemService(Context.SENSOR_SERVICE); } diff --git a/framework/src/org/apache/cordova/api/CordovaActivity.java b/framework/src/org/apache/cordova/api/CordovaInterface.java similarity index 97% rename from framework/src/org/apache/cordova/api/CordovaActivity.java rename to framework/src/org/apache/cordova/api/CordovaInterface.java index be2a12a4..b9b4b68a 100755 --- a/framework/src/org/apache/cordova/api/CordovaActivity.java +++ b/framework/src/org/apache/cordova/api/CordovaInterface.java @@ -25,7 +25,7 @@ import android.content.Intent; * The Cordova activity abstract class that is extended by DroidGap. * It is used to isolate plugin development, and remove dependency on entire Cordova library. */ -public abstract class CordovaActivity extends Activity { +public abstract class CordovaInterface extends Activity { /** * @deprecated diff --git a/framework/src/org/apache/cordova/api/IPlugin.java b/framework/src/org/apache/cordova/api/IPlugin.java index 90a3b1db..44349ee0 100755 --- a/framework/src/org/apache/cordova/api/IPlugin.java +++ b/framework/src/org/apache/cordova/api/IPlugin.java @@ -53,7 +53,7 @@ public interface IPlugin { * * @param ctx The context of the main Activity. */ - void setContext(CordovaActivity ctx); + void setContext(CordovaInterface ctx); /** * Sets the main View of the application, this is the WebView within which diff --git a/framework/src/org/apache/cordova/api/Plugin.java b/framework/src/org/apache/cordova/api/Plugin.java index 66bb1689..648e86d6 100755 --- a/framework/src/org/apache/cordova/api/Plugin.java +++ b/framework/src/org/apache/cordova/api/Plugin.java @@ -33,7 +33,7 @@ public abstract class Plugin implements IPlugin { public String id; public WebView webView; // WebView object - public CordovaActivity ctx; // CordovaActivity object + public CordovaInterface ctx; // CordovaActivity object /** * Executes the request and returns PluginResult. @@ -61,7 +61,7 @@ public abstract class Plugin implements IPlugin { * * @param ctx The context of the main Activity. */ - public void setContext(CordovaActivity ctx) { + public void setContext(CordovaInterface ctx) { this.ctx = ctx; } diff --git a/framework/src/org/apache/cordova/api/PluginManager.java b/framework/src/org/apache/cordova/api/PluginManager.java index 035aa914..43676698 100755 --- a/framework/src/org/apache/cordova/api/PluginManager.java +++ b/framework/src/org/apache/cordova/api/PluginManager.java @@ -43,7 +43,7 @@ public class PluginManager { private HashMap plugins = new HashMap(); private HashMap services = new HashMap(); - private final CordovaActivity ctx; + private final CordovaInterface ctx; private final WebView app; // Map URL schemes like foo: to plugins that want to handle those schemes @@ -56,7 +56,7 @@ public class PluginManager { * @param app * @param ctx */ - public PluginManager(WebView app, CordovaActivity ctx) { + public PluginManager(WebView app, CordovaInterface ctx) { this.ctx = ctx; this.app = app; this.loadPlugins(); @@ -138,7 +138,7 @@ public class PluginManager { try { final JSONArray args = new JSONArray(jsonArgs); final IPlugin plugin = this.getPlugin(service); - final CordovaActivity ctx = this.ctx; + final CordovaInterface ctx = this.ctx; if (plugin != null) { runAsync = async && !plugin.isSynch(action); if (runAsync) {