diff --git a/framework/src/org/apache/cordova/CallbackContext.java b/framework/src/org/apache/cordova/CallbackContext.java index 697eb26c..b9df45d5 100644 --- a/framework/src/org/apache/cordova/CallbackContext.java +++ b/framework/src/org/apache/cordova/CallbackContext.java @@ -23,7 +23,7 @@ import org.json.JSONArray; import android.util.Log; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.PluginResult; import org.json.JSONObject; public class CallbackContext { diff --git a/framework/src/org/apache/cordova/Config.java b/framework/src/org/apache/cordova/Config.java index 6a041cfb..4fa31f25 100644 --- a/framework/src/org/apache/cordova/Config.java +++ b/framework/src/org/apache/cordova/Config.java @@ -28,7 +28,7 @@ import java.util.Iterator; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; import org.xmlpull.v1.XmlPullParserException; diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index a68e5469..78c806d9 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -22,9 +22,9 @@ import java.util.HashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.CordovaPlugin; -import org.apache.cordova.api.LOG; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.LOG; import org.json.JSONException; import org.json.JSONObject; diff --git a/framework/src/org/apache/cordova/CordovaChromeClient.java b/framework/src/org/apache/cordova/CordovaChromeClient.java index 4d338a53..62a4eef4 100755 --- a/framework/src/org/apache/cordova/CordovaChromeClient.java +++ b/framework/src/org/apache/cordova/CordovaChromeClient.java @@ -18,8 +18,8 @@ */ package org.apache.cordova; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.LOG; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.LOG; import org.json.JSONArray; import org.json.JSONException; diff --git a/framework/src/org/apache/cordova/CordovaInterface.java b/framework/src/org/apache/cordova/CordovaInterface.java index 2b42f051..d500b2a1 100755 --- a/framework/src/org/apache/cordova/CordovaInterface.java +++ b/framework/src/org/apache/cordova/CordovaInterface.java @@ -21,7 +21,7 @@ package org.apache.cordova; import android.app.Activity; import android.content.Intent; -import org.apache.cordova.api.CordovaPlugin; +import org.apache.cordova.CordovaPlugin; import java.util.concurrent.ExecutorService; diff --git a/framework/src/org/apache/cordova/CordovaPlugin.java b/framework/src/org/apache/cordova/CordovaPlugin.java index 22c87030..456633b3 100644 --- a/framework/src/org/apache/cordova/CordovaPlugin.java +++ b/framework/src/org/apache/cordova/CordovaPlugin.java @@ -20,8 +20,8 @@ package org.apache.cordova; import org.apache.cordova.CordovaArgs; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CallbackContext; import org.apache.cordova.UriResolver; import org.json.JSONArray; import org.json.JSONException; diff --git a/framework/src/org/apache/cordova/CordovaWebView.java b/framework/src/org/apache/cordova/CordovaWebView.java index 96f7ac51..1035f3a7 100755 --- a/framework/src/org/apache/cordova/CordovaWebView.java +++ b/framework/src/org/apache/cordova/CordovaWebView.java @@ -27,10 +27,10 @@ import java.util.Stack; import java.util.regex.Pattern; import org.apache.cordova.Config; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.LOG; -import org.apache.cordova.api.PluginManager; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.LOG; +import org.apache.cordova.PluginManager; +import org.apache.cordova.PluginResult; import android.annotation.SuppressLint; import android.annotation.TargetApi; diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java index c49611e6..6dbc4ef3 100755 --- a/framework/src/org/apache/cordova/CordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java @@ -21,9 +21,9 @@ package org.apache.cordova; import java.io.ByteArrayInputStream; import java.util.Hashtable; -import org.apache.cordova.api.CordovaInterface; +import org.apache.cordova.CordovaInterface; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; import org.json.JSONException; import org.json.JSONObject; diff --git a/framework/src/org/apache/cordova/ExposedJsApi.java b/framework/src/org/apache/cordova/ExposedJsApi.java index 221dd3d5..7434c2ec 100755 --- a/framework/src/org/apache/cordova/ExposedJsApi.java +++ b/framework/src/org/apache/cordova/ExposedJsApi.java @@ -19,8 +19,8 @@ package org.apache.cordova; import android.webkit.JavascriptInterface; -import org.apache.cordova.api.PluginManager; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.PluginManager; +import org.apache.cordova.PluginResult; import org.json.JSONException; /** diff --git a/framework/src/org/apache/cordova/FileHelper.java b/framework/src/org/apache/cordova/FileHelper.java index 0b2ba1c7..5ac8f7a1 100644 --- a/framework/src/org/apache/cordova/FileHelper.java +++ b/framework/src/org/apache/cordova/FileHelper.java @@ -22,8 +22,8 @@ import android.database.Cursor; import android.net.Uri; import android.webkit.MimeTypeMap; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.LOG; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.LOG; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java index c23d5807..90007365 100644 --- a/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/IceCreamCordovaWebViewClient.java @@ -21,8 +21,8 @@ package org.apache.cordova; import java.io.IOException; import java.io.InputStream; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.LOG; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.LOG; import android.annotation.TargetApi; import android.net.Uri; diff --git a/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java b/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java index 52712ace..bb6b6a81 100755 --- a/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java +++ b/framework/src/org/apache/cordova/LinearLayoutSoftKeyboardDetect.java @@ -18,7 +18,7 @@ */ package org.apache.cordova; -import org.apache.cordova.api.LOG; +import org.apache.cordova.LOG; import android.content.Context; //import android.view.View.MeasureSpec; diff --git a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java index 8a13213f..d6ed4351 100755 --- a/framework/src/org/apache/cordova/NativeToJsMessageQueue.java +++ b/framework/src/org/apache/cordova/NativeToJsMessageQueue.java @@ -22,8 +22,8 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.LinkedList; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.PluginResult; import android.os.Message; import android.util.Log; diff --git a/framework/src/org/apache/cordova/PluginEntry.java b/framework/src/org/apache/cordova/PluginEntry.java index 2e21ba88..9f3c4dbb 100755 --- a/framework/src/org/apache/cordova/PluginEntry.java +++ b/framework/src/org/apache/cordova/PluginEntry.java @@ -19,8 +19,8 @@ package org.apache.cordova; import org.apache.cordova.CordovaWebView; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.CordovaPlugin; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; //import android.content.Context; //import android.webkit.WebView; @@ -125,7 +125,7 @@ public class PluginEntry { @SuppressWarnings("rawtypes") private boolean isCordovaPlugin(Class c) { if (c != null) { - return org.apache.cordova.api.CordovaPlugin.class.isAssignableFrom(c); + return org.apache.cordova.CordovaPlugin.class.isAssignableFrom(c); } return false; } diff --git a/framework/src/org/apache/cordova/PluginManager.java b/framework/src/org/apache/cordova/PluginManager.java index 40918f5a..768f2530 100755 --- a/framework/src/org/apache/cordova/PluginManager.java +++ b/framework/src/org/apache/cordova/PluginManager.java @@ -27,11 +27,11 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.cordova.CordovaArgs; import org.apache.cordova.CordovaWebView; import org.apache.cordova.UriResolver; -import org.apache.cordova.api.CallbackContext; -import org.apache.cordova.api.CordovaInterface; -import org.apache.cordova.api.CordovaPlugin; -import org.apache.cordova.api.PluginEntry; -import org.apache.cordova.api.PluginResult; +import org.apache.cordova.CallbackContext; +import org.apache.cordova.CordovaInterface; +import org.apache.cordova.CordovaPlugin; +import org.apache.cordova.PluginEntry; +import org.apache.cordova.PluginResult; import org.json.JSONException; import org.xmlpull.v1.XmlPullParserException; diff --git a/framework/src/org/apache/cordova/UriResolvers.java b/framework/src/org/apache/cordova/UriResolvers.java index dcb50016..00c8c977 100644 --- a/framework/src/org/apache/cordova/UriResolvers.java +++ b/framework/src/org/apache/cordova/UriResolvers.java @@ -290,4 +290,4 @@ public final class UriResolvers { } return new ThreadCheckingResolver(resolver); } -} \ No newline at end of file +} diff --git a/framework/src/org/apache/cordova/api/CallbackContext.java b/framework/src/org/apache/cordova/api/CallbackContext.java deleted file mode 100644 index 7eaae7e8..00000000 --- a/framework/src/org/apache/cordova/api/CallbackContext.java +++ /dev/null @@ -1,27 +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.api; - -import org.apache.cordova.CordovaWebView; - -public class CallbackContext extends org.apache.cordova.CallbackContext { - public CallbackContext(String callbackId, CordovaWebView webView) { - super(callbackId, webView); - } -} diff --git a/framework/src/org/apache/cordova/api/CordovaInterface.java b/framework/src/org/apache/cordova/api/CordovaInterface.java deleted file mode 100755 index 40b584b7..00000000 --- a/framework/src/org/apache/cordova/api/CordovaInterface.java +++ /dev/null @@ -1,26 +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.api; - -/** - * The Activity interface that is implemented by CordovaActivity. - * It is used to isolate plugin development, and remove dependency on entire Cordova library. - */ -public interface CordovaInterface extends org.apache.cordova.CordovaInterface { -} diff --git a/framework/src/org/apache/cordova/api/CordovaPlugin.java b/framework/src/org/apache/cordova/api/CordovaPlugin.java deleted file mode 100644 index 5830ed7d..00000000 --- a/framework/src/org/apache/cordova/api/CordovaPlugin.java +++ /dev/null @@ -1,22 +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.api; - -public class CordovaPlugin extends org.apache.cordova.CordovaPlugin { -} diff --git a/framework/src/org/apache/cordova/api/LOG.java b/framework/src/org/apache/cordova/api/LOG.java deleted file mode 100755 index 57972d7b..00000000 --- a/framework/src/org/apache/cordova/api/LOG.java +++ /dev/null @@ -1,22 +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.api; - -public class LOG extends org.apache.cordova.LOG { -} diff --git a/framework/src/org/apache/cordova/api/LegacyContext.java b/framework/src/org/apache/cordova/api/LegacyContext.java deleted file mode 100644 index fe154f7c..00000000 --- a/framework/src/org/apache/cordova/api/LegacyContext.java +++ /dev/null @@ -1,154 +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.api; - -import android.app.Activity; -import android.content.BroadcastReceiver; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.content.SharedPreferences; -import android.content.pm.PackageManager; -import android.content.res.AssetManager; -import android.content.res.Resources; -import android.util.Log; - -import java.util.concurrent.ExecutorService; - -@Deprecated -public class LegacyContext implements CordovaInterface { - private static final String LOG_TAG = "Deprecation Notice"; - private CordovaInterface cordova; - - public LegacyContext(CordovaInterface cordova) { - this.cordova = cordova; - } - - @Deprecated - public void cancelLoadUrl() { - Log.i(LOG_TAG, "Replace ctx.cancelLoadUrl() with cordova.cancelLoadUrl()"); - } - - @Deprecated - public Activity getActivity() { - Log.i(LOG_TAG, "Replace ctx.getActivity() with cordova.getActivity()"); - return this.cordova.getActivity(); - } - - @Deprecated - public Context getContext() { - Log.i(LOG_TAG, "Replace ctx.getContext() with cordova.getContext()"); - return this.cordova.getActivity(); - } - - @Deprecated - public Object onMessage(String arg0, Object arg1) { - Log.i(LOG_TAG, "Replace ctx.onMessage() with cordova.onMessage()"); - return this.cordova.onMessage(arg0, arg1); - } - - @Deprecated - public void setActivityResultCallback(CordovaPlugin arg0) { - Log.i(LOG_TAG, "Replace ctx.setActivityResultCallback() with cordova.setActivityResultCallback()"); - this.cordova.setActivityResultCallback(arg0); - } - - @Deprecated - public void startActivityForResult(CordovaPlugin arg0, Intent arg1, int arg2) { - Log.i(LOG_TAG, "Replace ctx.startActivityForResult() with cordova.startActivityForResult()"); - this.cordova.startActivityForResult(arg0, arg1, arg2); - } - - @Deprecated - public void startActivity(Intent intent) { - Log.i(LOG_TAG, "Replace ctx.startActivity() with cordova.getActivity().startActivity()"); - this.cordova.getActivity().startActivity(intent); - } - - @Deprecated - public Object getSystemService(String name) { - Log.i(LOG_TAG, "Replace ctx.getSystemService() with cordova.getActivity().getSystemService()"); - return this.cordova.getActivity().getSystemService(name); - } - - @Deprecated - public AssetManager getAssets() { - Log.i(LOG_TAG, "Replace ctx.getAssets() with cordova.getActivity().getAssets()"); - return this.cordova.getActivity().getAssets(); - } - - @Deprecated - public void runOnUiThread(Runnable runnable) { - Log.i(LOG_TAG, "Replace ctx.runOnUiThread() with cordova.getActivity().runOnUiThread()"); - this.cordova.getActivity().runOnUiThread(runnable); - } - - @Deprecated - public Context getApplicationContext() { - Log.i(LOG_TAG, "Replace ctx.getApplicationContext() with cordova.getActivity().getApplicationContext()"); - return this.cordova.getActivity().getApplicationContext(); - } - - @Deprecated - public PackageManager getPackageManager() { - Log.i(LOG_TAG, "Replace ctx.getPackageManager() with cordova.getActivity().getPackageManager()"); - return this.cordova.getActivity().getPackageManager(); - } - - @Deprecated - public SharedPreferences getSharedPreferences(String name, int mode) { - Log.i(LOG_TAG, "Replace ctx.getSharedPreferences() with cordova.getActivity().getSharedPreferences()"); - return this.cordova.getActivity().getSharedPreferences(name, mode); - } - - @Deprecated - public void unregisterReceiver(BroadcastReceiver receiver) { - Log.i(LOG_TAG, "Replace ctx.unregisterReceiver() with cordova.getActivity().unregisterReceiver()"); - this.cordova.getActivity().unregisterReceiver(receiver); - } - - @Deprecated - public Resources getResources() { - Log.i(LOG_TAG, "Replace ctx.getResources() with cordova.getActivity().getResources()"); - return this.cordova.getActivity().getResources(); - } - - @Deprecated - public ComponentName startService(Intent service) { - Log.i(LOG_TAG, "Replace ctx.startService() with cordova.getActivity().startService()"); - return this.cordova.getActivity().startService(service); - } - - @Deprecated - public boolean bindService(Intent service, ServiceConnection conn, int flags) { - Log.i(LOG_TAG, "Replace ctx.bindService() with cordova.getActivity().bindService()"); - return this.cordova.getActivity().bindService(service, conn, flags); - } - - @Deprecated - public void unbindService(ServiceConnection conn) { - Log.i(LOG_TAG, "Replace ctx.unbindService() with cordova.getActivity().unbindService()"); - this.cordova.getActivity().unbindService(conn); - } - - public ExecutorService getThreadPool() { - Log.i(LOG_TAG, "Replace ctx.getThreadPool() with cordova.getThreadPool()"); - return this.cordova.getThreadPool(); - } -} diff --git a/framework/src/org/apache/cordova/api/Plugin.java b/framework/src/org/apache/cordova/api/Plugin.java deleted file mode 100755 index 72171f2a..00000000 --- a/framework/src/org/apache/cordova/api/Plugin.java +++ /dev/null @@ -1,177 +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.api; - -import org.apache.cordova.CordovaWebView; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -/** - * Legacy Plugin class. This acts as a shim to support the old execute() signature. - * New plugins should extend CordovaPlugin directly. - */ -@Deprecated -public abstract class Plugin extends CordovaPlugin { - public LegacyContext ctx; // LegacyContext object - - public abstract PluginResult execute(String action, JSONArray args, String callbackId); - - public boolean isSynch(String action) { - return false; - } - - @Override - public void initialize(CordovaInterface cordova, CordovaWebView webView) { - super.initialize(cordova, webView); - this.setContext(cordova); - this.setView(webView); - } - - /** - * Sets the context of the Plugin. This can then be used to do things like - * get file paths associated with the Activity. - * - * @param ctx The context of the main Activity. - */ - public void setContext(CordovaInterface ctx) { - this.cordova = ctx; - this.ctx = new LegacyContext(cordova); - } - - /** - * Sets the main View of the application, this is the WebView within which - * a Cordova app runs. - * - * @param webView The Cordova WebView - */ - public void setView(CordovaWebView webView) { - this.webView = webView; - } - - @Override - public boolean execute(final String action, final JSONArray args, final CallbackContext callbackContext) throws JSONException { - final String callbackId = callbackContext.getCallbackId(); - boolean runAsync = !isSynch(action); - if (runAsync) { - // Run this on a different thread so that this one can return back to JS - cordova.getThreadPool().execute(new Runnable() { - public void run() { - PluginResult cr; - try { - cr = execute(action, args, callbackId); - } catch (Throwable e) { - cr = new PluginResult(PluginResult.Status.ERROR, e.getMessage()); - } - sendPluginResult(cr, callbackId); - } - }); - } else { - PluginResult cr = execute(action, args, callbackId); - - // Interpret a null response as NO_RESULT, which *does* clear the callbacks on the JS side. - if (cr == null) { - cr = new PluginResult(PluginResult.Status.NO_RESULT); - } - - callbackContext.sendPluginResult(cr); - } - return true; - } - - /** - * Send generic JavaScript statement back to JavaScript. - * sendPluginResult() should be used instead where possible. - */ - public void sendJavascript(String statement) { - this.webView.sendJavascript(statement); - } - - /** - * Send generic JavaScript statement back to JavaScript. - */ - public void sendPluginResult(PluginResult pluginResult, String callbackId) { - this.webView.sendPluginResult(pluginResult, callbackId); - } - - /** - * Call the JavaScript success callback for this plugin. - * - * This can be used if the execute code for the plugin is asynchronous meaning - * that execute should return null and the callback from the async operation can - * call success(...) or error(...) - * - * @param pluginResult The result to return. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void success(PluginResult pluginResult, String callbackId) { - this.webView.sendPluginResult(pluginResult, callbackId); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void success(JSONObject message, String callbackId) { - this.webView.sendPluginResult(new PluginResult(PluginResult.Status.OK, message), callbackId); - } - - /** - * Helper for success callbacks that just returns the Status.OK by default - * - * @param message The message to add to the success result. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void success(String message, String callbackId) { - this.webView.sendPluginResult(new PluginResult(PluginResult.Status.OK, message), callbackId); - } - - /** - * Call the JavaScript error callback for this plugin. - * - * @param pluginResult The result to return. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void error(PluginResult pluginResult, String callbackId) { - this.webView.sendPluginResult(pluginResult, callbackId); - } - - /** - * Helper for error callbacks that just returns the Status.ERROR by default - * - * @param message The message to add to the error result. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void error(JSONObject message, String callbackId) { - this.webView.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message), callbackId); - } - - /** - * Helper for error callbacks that just returns the Status.ERROR by default - * - * @param message The message to add to the error result. - * @param callbackId The callback id used when calling back into JavaScript. - */ - public void error(String message, String callbackId) { - this.webView.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message), callbackId); - } - -} diff --git a/framework/src/org/apache/cordova/api/PluginEntry.java b/framework/src/org/apache/cordova/api/PluginEntry.java deleted file mode 100755 index 0f6c11da..00000000 --- a/framework/src/org/apache/cordova/api/PluginEntry.java +++ /dev/null @@ -1,29 +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.api; - -public class PluginEntry extends org.apache.cordova.PluginEntry { - public PluginEntry(String service, String pluginClass, boolean onload) { - super(service, pluginClass, onload); - } - - public PluginEntry(String service, CordovaPlugin plugin) { - super(service, plugin); - } -} diff --git a/framework/src/org/apache/cordova/api/PluginManager.java b/framework/src/org/apache/cordova/api/PluginManager.java deleted file mode 100755 index d7fddfe5..00000000 --- a/framework/src/org/apache/cordova/api/PluginManager.java +++ /dev/null @@ -1,27 +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.api; - -import org.apache.cordova.CordovaWebView; - -public class PluginManager extends org.apache.cordova.PluginManager { - public PluginManager(CordovaWebView app, CordovaInterface ctx) { - super(app, ctx); - } -} diff --git a/framework/src/org/apache/cordova/api/PluginResult.java b/framework/src/org/apache/cordova/api/PluginResult.java deleted file mode 100755 index 39d39832..00000000 --- a/framework/src/org/apache/cordova/api/PluginResult.java +++ /dev/null @@ -1,60 +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.api; - -import org.json.JSONArray; -import org.json.JSONObject; - -public class PluginResult extends org.apache.cordova.PluginResult { - public PluginResult(Status status) { - super(status); - } - - public PluginResult(Status status, String message) { - super(status, message); - } - - public PluginResult(Status status, JSONArray message) { - super(status, message); - } - - public PluginResult(Status status, JSONObject message) { - super(status, message); - } - - public PluginResult(Status status, int i) { - super(status, i); - } - - public PluginResult(Status status, float f) { - super(status, f); - } - - public PluginResult(Status status, boolean b) { - super(status, b); - } - - public PluginResult(Status status, byte[] data) { - super(status, data); - } - - public PluginResult(Status status, byte[] data, boolean binaryString) { - super(status, data, binaryString); - } -}