From 81059b398f7d739c186f34bdec696885ed31f377 Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 19 Apr 2012 16:35:55 -0700 Subject: [PATCH 1/4] Proper fix for CB-164. Online/offline events now propagated to webview properly --- framework/src/org/apache/cordova/NetworkManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/NetworkManager.java b/framework/src/org/apache/cordova/NetworkManager.java index 0fac00ff..058757f3 100755 --- a/framework/src/org/apache/cordova/NetworkManager.java +++ b/framework/src/org/apache/cordova/NetworkManager.java @@ -58,7 +58,7 @@ public class NetworkManager extends Plugin { public static final String LTE = "lte"; public static final String UMB = "umb"; public static final String HSPA_PLUS = "hspa+"; - // return types + // return type public static final String TYPE_UNKNOWN = "unknown"; public static final String TYPE_ETHERNET = "ethernet"; public static final String TYPE_WIFI = "wifi"; @@ -123,6 +123,7 @@ public class NetworkManager extends Plugin { this.connectionCallbackId = callbackId; NetworkInfo info = sockMan.getActiveNetworkInfo(); PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, this.getConnectionInfo(info)); + pluginResult.setKeepCallback(true); return pluginResult; } @@ -195,6 +196,7 @@ public class NetworkManager extends Plugin { */ private void sendUpdate(String type) { PluginResult result = new PluginResult(PluginResult.Status.OK, type); + result.setKeepCallback(true); this.success(result, this.connectionCallbackId); // Send to all plugins From bcc2957f209300bc08398c7ad27995eb9ae7cf44 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Thu, 19 Apr 2012 16:45:15 -0700 Subject: [PATCH 2/4] Fix for CB-549 --- framework/src/org/apache/cordova/Notification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/Notification.java b/framework/src/org/apache/cordova/Notification.java index 9fb423a7..b5834c3e 100755 --- a/framework/src/org/apache/cordova/Notification.java +++ b/framework/src/org/apache/cordova/Notification.java @@ -233,7 +233,7 @@ public class Notification extends Plugin { // First button if (fButtons.length > 0) { - dlg.setPositiveButton(fButtons[0], + dlg.setNegativeButton(fButtons[0], new AlertDialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); @@ -255,7 +255,7 @@ public class Notification extends Plugin { // Third button if (fButtons.length > 2) { - dlg.setNegativeButton(fButtons[2], + dlg.setPositiveButton(fButtons[2], new AlertDialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); From 3835144b93f2212db72313eb2d414fb44133ab9d Mon Sep 17 00:00:00 2001 From: Fil Maj Date: Thu, 19 Apr 2012 17:25:19 -0700 Subject: [PATCH 3/4] [CB-473] run ant clean before ant debug install --- bin/templates/project/cordova/debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/project/cordova/debug b/bin/templates/project/cordova/debug index 8dd31874..0bac2c79 100755 --- a/bin/templates/project/cordova/debug +++ b/bin/templates/project/cordova/debug @@ -4,6 +4,6 @@ # if there are no devices listed then emulate - +ant clean ant debug install adb shell am start -n $PACKAGE/$PACKAGE.$ACTIVITY From 05192a91dab9b57ced75dd771028533bddbe9d9e Mon Sep 17 00:00:00 2001 From: macdonst Date: Thu, 19 Apr 2012 21:03:55 -0400 Subject: [PATCH 4/4] Removing un-needed logs --- .../src/org/apache/cordova/DroidGap.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 031bb457..4e7e59e0 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -1072,31 +1072,6 @@ public class DroidGap extends Activity implements CordovaInterface { this.finish(); } - - /** - * Called when the back key is pressed - * - * (non-Javadoc) - * @see android.app.Activity#onBackPressed() - */ - /* - @Override - public void onBackPressed() - { - Log.d("BackPressed", "in onBackPressed"); - Log.d("BackPressed", "bound = " + this.bound); - //Log.d("BackPressed", "backHistory = " + this.backHistory()); - // If back key is bound, then send event to JavaScript - - if (!(this.bound || this.backHistory())) { - Log.d("BackPressed", "exiting"); - this.activityState = ACTIVITY_EXITING; - super.onBackPressed(); - } - } - */ - - /** * Called when a key is de-pressed. (Key UP) * @@ -1111,11 +1086,8 @@ public class DroidGap extends Activity implements CordovaInterface { // If back key if (keyCode == KeyEvent.KEYCODE_BACK) { - Log.d("BackButton", "I got an up from KEYCODE_BACK"); - // If back key is bound, then send event to JavaScript if (this.bound) { - Log.d("BackButton", "bound is true firing an event to JS"); this.appView.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');"); return true; } else { @@ -1144,7 +1116,6 @@ public class DroidGap extends Activity implements CordovaInterface { return true; } - Log.d("BackPressed", "returning false"); return false; }