[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-09 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14165681#comment-14165681
 ] 

ASF subversion and git services commented on CB-6837:
-

Commit 346f53dc338765e6f5f28fb8b1d5f173a51d3e16 in cordova-amazon-fireos's 
branch refs/heads/master from [~martin.c.glez.glez]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-amazon-fireos.git;h=346f53d 
]

CB-6837 Fix leaked window when hitting back button while alert being rendered

Keep track of the last AlertDialog showed.
The last dialog showed that is rendered while hitting back button it
causes a leaked window.
Instead of perform a full track of all dialogs created, only destroy the
last one showed, this fixes the problem.

close #122

Conflicts:

framework/src/org/apache/cordova/CordovaChromeClient.java


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14163585#comment-14163585
 ] 

ASF GitHub Bot commented on CB-6837:


Github user asfgit closed the pull request at:

https://github.com/apache/cordova-android/pull/123


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159261#comment-14159261
 ] 

ASF subversion and git services commented on CB-6837:
-

Commit 890e12c30674d7b4dff54082e9ee879505475e19 in cordova-android's branch 
refs/heads/4.0.x from [~martin.c.glez.glez]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=890e12c ]

CB-6837 Fix leaked window when hitting back button while alert being rendered

Keep track of the last AlertDialog showed.
The last dialog showed that is rendered while hitting back button it
causes a leaked window.
Instead of perform a full track of all dialogs created, only destroy the
last one showed, this fixes the problem.

close #122


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159262#comment-14159262
 ] 

ASF subversion and git services commented on CB-6837:
-

Commit 890e12c30674d7b4dff54082e9ee879505475e19 in cordova-android's branch 
refs/heads/master from [~martin.c.glez.glez]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=890e12c ]

CB-6837 Fix leaked window when hitting back button while alert being rendered

Keep track of the last AlertDialog showed.
The last dialog showed that is rendered while hitting back button it
causes a leaked window.
Instead of perform a full track of all dialogs created, only destroy the
last one showed, this fixes the problem.

close #122


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14159263#comment-14159263
 ] 

ASF GitHub Bot commented on CB-6837:


Github user asfgit closed the pull request at:

https://github.com/apache/cordova-android/pull/122


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-03 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157724#comment-14157724
 ] 

Martin Gonzalez commented on CB-6837:
-

Hi Ian, 
I've made the required changes to fix this bug, by keeping track of the last 
AlertDialog showed.
Given the fact that the last one that is showed causes the leaked window, it 
would better in this way. The original idea it was keep track of all of them, 
and perform that cleanup, but now it seems like an unnecessary burden for a 
large amount of alerts in the application.

I've made a clean up of the PRs for master and 4.0.x branch, and are ready to 
be reviewed:
Master: https://github.com/apache/cordova-android/pull/122
4.0.x: https://github.com/apache/cordova-android/pull/123

Thanks.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14156967#comment-14156967
 ] 

Ian Clelland commented on CB-6837:
--

The code looks pretty clean, and I think it's in the right place :)

The first thing I'm wondering about the code is that there doesn't seem to be 
any way for items to be removed from the ArrayList -- if a long-running page 
generates many dialogs, will they all stay in that list even long after they 
are closed? And in that case, what happens when the back button is pressed?


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14156983#comment-14156983
 ] 

Ian Clelland commented on CB-6837:
--

I build a small sample like this:

{code:title=index.html}
a href=index2.htmlPage 2/a
{code}

{code:title=index2.html}
script
for (var x=0; x  10; ++x) {
  alert(This is number  + x);
}
/script
{code}

The normal flow is to click Page 2, and then dismiss all 10 dialogs, and the 
hit the back button. That seems to work correctly.

If I instead start hitting the back button while a dialog is displayed, it 
seems to quickly overlay the *next* dialog in the sequence, and the next one. 
Eventually, they're all displayed, stacked. After that, hitting back dismisses 
them one at a time, until they're all gone, and *then* hitting back one more 
time goes back to page 1.

(This is on the L preview; I'l try it on 4.4 next to see if it's new behaviour)

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157025#comment-14157025
 ] 

Ian Clelland commented on CB-6837:
--

Same behaviour on 4.4.4

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157035#comment-14157035
 ] 

Martin Gonzalez commented on CB-6837:
-

Hey Ian, I'm just getting back from lunch, let me take a look.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157056#comment-14157056
 ] 

Martin Gonzalez commented on CB-6837:
-

Yes, I see what you are saying, the problem is the current or last dialog 
showed, that's the one that causes the exception. Alright then, you are saying 
that it would be better just store that last dialog showed instead of all of 
them and dismiss it during onDestroy. If that's the case an ArrayList it 
wouldn't be required. The goal was perform a cleanup of all dialogs showed over 
during onDestroy.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157074#comment-14157074
 ] 

Ian Clelland commented on CB-6837:
--

If multiple dialogs are queued, is the intended behavior is to have the back 
button immediately go back to the previous page, or to dismiss the current 
dialog and let the page proceed?

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-10-02 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14157091#comment-14157091
 ] 

Martin Gonzalez commented on CB-6837:
-

I would say that if it doesn't cause the window leaked that would be fine.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-22 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143435#comment-14143435
 ] 

Martin Gonzalez commented on CB-6837:
-

Ok, sounds good.
I'll do a rebase with master, in order to merge the changes cleanly with 
master. Also I'll add the changes to the 4.x branch on android, to get them 
merge and take out that burden from you guys, it should be a rule that, if you 
are fixing something on master you have to provide its respective fix for 
android 4.x branch too.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143485#comment-14143485
 ] 

ASF GitHub Bot commented on CB-6837:


Github user martincgg closed the pull request at:

https://github.com/apache/cordova-android/pull/117


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143703#comment-14143703
 ] 

ASF GitHub Bot commented on CB-6837:


GitHub user martincgg opened a pull request:

https://github.com/apache/cordova-android/pull/122

[CB-6837][Android] Fix: leaked window when hitting back button while alert 
being rendered

Created arrayList on ChromeClient that it will register all showed 
AlertDialog, using CordovaChromeClient class, this applies to AlertDialogs 
object, included messages, prompts and confirm AlertDialog objects.

When handleDestroy() method is called on the CordovaWebView, it will 
perform a call to ChromeClient class to destroy all AlerDialogs objects 
registered on the arrayList.
This would perform a cleanup before the CordovaActivity is destroyed.

dlg.show() returns an AlertDialog object, to be added to the arrayList.
It can be:
dialogsManager.add(dlg.show());
But I think it looks cleaner as currently is.

Tested on 4.2.2  4.4.2.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/martincgg/cordova-android CB-6837

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/122.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #122


commit 0cb49e37687e032594e5eab9d4c5806beac124f4
Author: Martin Gonzalez martin.c.glez.g...@gmail.com
Date:   2014-09-22T19:45:58Z

[CB-6837][Android] Fix: leaked window when hitting back button while alert 
being rendered

Created arrayList on ChromeClient that it will register all showed
AlertDialog, using CordovaChromeClient class, this applies to
AlertDialogs object, included messages, prompts and confirm AlertDialog
objects.

When handleDestroy() method is called on the CordovaWebView, it will
perform a call to ChromeClient class to destroy all AlerDialogs objects
registered on the arrayList.
This would perform a cleanup before the CordovaActivity is destroyed.

dlg.show() returns an AlertDialog object, to be added to the arrayList.
It can be:
dialogsManager.add(dlg.show());
But I think it looks cleaner as currently is.

Tested on 4.2.2  4.4.2.




 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143757#comment-14143757
 ] 

ASF GitHub Bot commented on CB-6837:


GitHub user martincgg opened a pull request:

https://github.com/apache/cordova-android/pull/123

[CB-6837][Android 4.0.x branch] Fix: leaked window when hitting back button 
while alert being rendered

CB-6837
It is basically:
https://github.com/apache/cordova-android/pull/122 
Only this is refactored for 4.0.x branch.

Description:
Created arrayList on AndroidChromeClient that it will register all showed 
AlertDialog, using AndroidChromeClient class, this applies to AlertDialogs 
object, included messages, prompts and confirm AlertDialog objects.

When handleDestroy() method is called on the AndroidWebView, it will 
perform a call to AndroidChromeClient class to destroy all AlerDialogs objects 
registered on the arrayList.
This would perform a cleanup before the CordovaActivity is destroyed.

dlg.show() returns an AlertDialog object, to be added to the arrayList.
It can be:
dialogsManager.add(dlg.show());
But I think it looks cleaner as currently is.

Tested on 4.4.2.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/martincgg/cordova-android CB-6837_4.0.x

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/123.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #123


commit a582fe9c9e5f7118647dceb7ed6103a976febbc6
Author: Martin Gonzalez martin.c.glez.g...@gmail.com
Date:   2014-09-22T20:24:47Z

[CB-6837][Android 4.0.x] Fix: leaked window when hitting back button while 
alert being rendered

Created arrayList on ChromeClient that it will register all showed
AlertDialog, using CordovaChromeClient class, this applies to
AlertDialogs object, included messages, prompts and confirm AlertDialog
objects.

When handleDestroy() method is called on the CordovaWebView, it will
perform a call to ChromeClient class to destroy all AlerDialogs objects
registered on the arrayList.
This would perform a cleanup before the CordovaActivity is destroyed.

dlg.show() returns an AlertDialog object, to be added to the arrayList.
It can be:
dialogsManager.add(dlg.show());
But I think it looks cleaner as currently is.

Tested on 4.2.2  4.4.2.




 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178): 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-22 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14143770#comment-14143770
 ] 

Martin Gonzalez commented on CB-6837:
-

Hi [~bowserj], [~iclelland].
I've did a rebase to catch up with master and 4.0.x branch. I've made two PRs, 
one for master and the other one against 4.0.x branch.
Can you guys take a look at them?
[Master] https://github.com/apache/cordova-android/pull/122
[4.0.x] https://github.com/apache/cordova-android/pull/123

Thanks.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-19 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140654#comment-14140654
 ] 

Ian Clelland commented on CB-6837:
--

The takeaway seems to be that concrete instances of CordovaWebView should keep 
track of dialogs that they create, and destroy any open ones if they are 
destroyed -- is that right?

The API change would be small -- one method on CordovaWebView (although it 
might be better to implement it as {{CordovaWebView.onDestroy()}}, which can 
then do whatever it needs to in order to clean up -- in the future, it might be 
more than just {{destroyDialogs}})

I can make the corresponding changes on Cordova-Crosswalk-Engine.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140752#comment-14140752
 ] 

ASF GitHub Bot commented on CB-6837:


Github user martincgg commented on a diff in the pull request:

https://github.com/apache/cordova-android/pull/117#discussion_r17791920
  
--- Diff: framework/src/org/apache/cordova/CordovaChromeClient.java ---
@@ -123,7 +128,8 @@ public boolean onKey(DialogInterface dialog, int 
keyCode, KeyEvent event) {
 return true;
 }
 });
-dlg.show();
+AlertDialog alert = dlg.show();
--- End diff --

dlg.show(); can be added complete to the next line, avoiding variable 
creation.


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-19 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140771#comment-14140771
 ] 

Martin Gonzalez commented on CB-6837:
-

Hi [~iclelland], I've made some changes, removed: removeDialogs method on 
CordovaWebView, and CordovaActivity involvement:
https://github.com/apache/cordova-android/pull/117/files

It is possible to keep the track from the CordovaWebView, using some method at 
the ChromeClient to send the references back onDialogs creation, and handle the 
whole dialogs destruction on the WebView.
Although, I haven't tried to find a way to keep track of all dialogs created, 
without touching the CordovaChromeClient class at all, do you have any insights 
that you want to share?


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-19 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14140943#comment-14140943
 ] 

Joe Bowser commented on CB-6837:


Do you have to use the CordovaChromeClient for this? This class will most 
likely not exist in Cordova 4.0, and will only exist on certain implementations.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-19 Thread Ian Clelland (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14141032#comment-14141032
 ] 

Ian Clelland commented on CB-6837:
--

CordovaChromeClient seems like the right place to put this, on the master/3.x 
branch. That's the class that creates the dialogs; it should be the one to keep 
track of them, and eventually destroy them.

It's not appropriate for 4.0.x, but this is exactly the sort of code that needs 
to be modified for 4.0.x anyway.

(WebChromeClient (and CordovaChromeClient) is an implementation detail that is 
specific to the stock Android WebView. Crosswalk uses 
{{org.xwalk.core.internal.XWalkUIClient}}, and even that's subject to change. I 
have no idea what GeckoView does, but I suspect it's radically different again.

In fact, CordovaChromeClient is already gone from the 4.0.x; replaced by the 
hopefully-obviously-android-specific AndroidChromeClient class.)

The right thing to do is to have CordovaActivity tell its CordovaWebView, 
whatever class that happens to be, that it's about to be destroyed, and the 
various CordovaWebView subclasses will just know how to clean up. That looks 
like what this patch is now doing.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139209#comment-14139209
 ] 

Martin Gonzalez commented on CB-6837:
-

Hey [~bowserj], well the CordovaChromeClient will capture all dialogs and keep 
a record of them, CordovaActivy doesn't have a direct access to the 
chromeClient, the other way to do so, it would be call 'destroyAllDialogs' 
(this.chromeClient.destroyAllDialogs()) , from 'handleDestroy()' at 
CordovaWebView. Removing the CordovaActivity involvement and also 
'destroyDialogs' method from the CordovaWebView.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139235#comment-14139235
 ] 

Joe Bowser commented on CB-6837:


I think handleDestroy would have to be where this lives, and I really don't 
want extra code in CordovaWebView or CordovaChromeClient, especially since 
those classes have been through a massive refactor.  I can't accept the pull 
request as is right now since it's not compatible with the 4.0.x branch.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139286#comment-14139286
 ] 

Martin Gonzalez commented on CB-6837:
-

1.- I can, just use the CordovaView to call the destruction of the dialogs, at 
the chromeClient, without touch the activity, refactor all of it, and make a PR 
for 4.x too, addressing to its respective classes there.

2.- Do not touch ChromeClient at all, and somehow fix the issue just during 
handleDestroy() at CordovaWebView/AndroidWebView (refactor too).

3.- Can't accept any of this changes for any of the classes, don't spend more 
time with it.

well Joe, could you please tell me, which path should I follow?

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139479#comment-14139479
 ] 

Joe Bowser commented on CB-6837:


On Thu, Sep 18, 2014 at 11:22 AM, Martin Gonzalez (JIRA) j...@apache.org



 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139482#comment-14139482
 ] 

Joe Bowser commented on CB-6837:


OK, sorry about the blank message.  Here's my comment.

On Thu, Sep 18, 2014 at 11:22 AM, Martin Gonzalez (JIRA) j...@apache.org

The ChromeClient is no longer part of the Third-Party WebView API, so this
is a non-starter.



This would require an API change, and would have to be implemented on all
Third Party WebViews



This is the easiest, but the bug still exists.



Either two or three, but I think that Ian should also comment on this API
change, since this affects his work as well.




 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This 

[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-18 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14139621#comment-14139621
 ] 

Martin Gonzalez commented on CB-6837:
-

Ok, I'll try to do this in another way.
[~iclelland] do you have any comments regarding this issue?


 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-17 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14138071#comment-14138071
 ] 

Joe Bowser commented on CB-6837:


If you want your pull requests reviewed faster, assign to a committer on JIRA.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Joe Bowser
Priority: Minor
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-17 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14138077#comment-14138077
 ] 

Martin Gonzalez commented on CB-6837:
-

I'll keep it in mind next time, Thanks.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Joe Bowser
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-09-17 Thread Joe Bowser (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14138123#comment-14138123
 ] 

Joe Bowser commented on CB-6837:


Can this code not be located in the CordovaWebView/CordovaChromeClient? This 
problem will re-appear in Android 4.0 based on the current implementation.

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Joe Bowser
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-08-22 Thread Martin Gonzalez (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14107516#comment-14107516
 ] 

Martin Gonzalez commented on CB-6837:
-

the Alert dialog, it throws the exception above described, because when it 
tries to destroy the view, the dialog object makes an attempt to perform on the 
view.
The workaround it should be avoid that exception, by destroying or dismiss all 
alert objects during onDestroy().

 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
Priority: Minor
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)
 E/WindowManager( 8178):   at 
 java.lang.reflect.Method.invoke(Method.java:515)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
 E/WindowManager( 8178):   at 
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
 E/WindowManager( 8178):   at dalvik.system.NativeStart.main(Native Method)
 D/CordovaWebViewClient( 8178): onPageFinished(about:blank)
 D/CordovaActivity( 8178): onMessage(onPageFinished,about:blank)
 D/CordovaActivity( 8178): onMessage(exit,null)
 It looks like there is an attempt to show the alert dialog after the 
 activity's onDestroy() method has been called.
 When resuming the app by clicking on it's icon in the home screen or using 
 the Multitask button, the webview doesn't render completely, I see only a 
 black screen with the usual status bar. The app must be killed, and then it 
 works fine after a restart. It appears that there is a pretty small time 
 window during the timeout in which this can be reproduced, something on the 
 order of 200ms.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6837) Hitting Back button while alert being rendered causes leaked window

2014-08-22 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CB-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14107638#comment-14107638
 ] 

ASF GitHub Bot commented on CB-6837:


GitHub user martincgg opened a pull request:

https://github.com/apache/cordova-android/pull/117

[CB-6837][Android] Fix: leaked window when hitting back button while alert 
being rendered

Created arrayList on ChromeClient that it will register all showed 
AlertDialog, using CordovaChromeClient class, this applies to AlertDialogs 
object, included messages, prompts and confirm AlertDialog objects.

When onDestroy() method is called on the CordovaActivity, it will perform a 
call to ChromeClient class to destroy all AlerDialogs objects registered on the 
arrayList.
This would perform a cleanup before the CordovaActivity is destroyed.

dlg.show() returns an AlertDialog object, to be added to the arrayList.
It can be: 
dialogsManager.add(dlg.show());

But I think it looks cleaner as is already.

Tested on 4.2.2  4.4.2.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/martincgg/cordova-android CB-6837

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cordova-android/pull/117.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #117


commit 1dcadbcbb28053b5f9ec81feb2d40660d2978974
Author: Martin Gonzalez martin.c.glez.g...@gmail.com
Date:   2014-08-22T22:43:04Z

[CB-6837 - Android] Fix leaked window when hitting back button while alert 
being rendered




 Hitting Back button while alert being rendered causes leaked window
 ---

 Key: CB-6837
 URL: https://issues.apache.org/jira/browse/CB-6837
 Project: Apache Cordova
  Issue Type: Bug
  Components: Android
Affects Versions: 3.5.0
Reporter: Marcel Kinard
Assignee: Martin Gonzalez
Priority: Minor
 Attachments: index.html


 On master and using dialogs plugin. Using a trivial app that has a button to 
 create an alert dialog after 500ms timeout. If the Back button is hit at 
 approximately the same time as the timer expires and the alert is to be 
 shown, the following exception appears in logcat:
 D/CordovaWebView( 8178): The current URL is: 
 file:///android_asset/www/index.html
 D/CordovaWebView( 8178): The URL at item 0 is: 
 file:///android_asset/www/index.html
 D/dalvikvm(  513): GC_FOR_ALLOC freed 306K, 13% free 14164K/16240K, paused 
 54ms, total 55ms
 D/CordovaActivity( 8178): Paused the application!
 D/CordovaWebView( 8178): Handle the pause
 W/IInputConnectionWrapper( 8178): showStatusIcon on inactive InputConnection
 W/InputMethodManagerService(  513): Starting input on non-focused client 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@42396598 (uid=10050 
 pid=8178)
 D/CordovaActivity( 8178): CordovaActivity.onDestroy()
 D/CordovaWebView( 8178):  loadUrlNow()
 E/WindowManager( 8178): 
 E/WindowManager( 8178): android.view.WindowLeaked: Activity 
 com.example.Example has leaked window 
 com.android.internal.policy.impl.PhoneWindow$DecorView{41f0d8b8 V.E. 
 R.I. 0,0-465,256} that was originally added here
 E/WindowManager( 8178):   at 
 android.view.ViewRootImpl.init(ViewRootImpl.java:348)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248)
 E/WindowManager( 8178):   at 
 android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
 E/WindowManager( 8178):   at android.app.Dialog.show(Dialog.java:286)
 E/WindowManager( 8178):   at 
 android.app.AlertDialog$Builder.show(AlertDialog.java:951)
 E/WindowManager( 8178):   at 
 org.apache.cordova.CordovaChromeClient.onJsAlert(CordovaChromeClient.java:143)
 E/WindowManager( 8178):   at 
 com.android.webview.chromium.WebViewContentsClientAdapter.handleJsAlert(WebViewContentsClientAdapter.java:606)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.android_webview.AwContentsClientBridge.handleJsAlert(AwContentsClientBridge.java:73)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native 
 Method)
 E/WindowManager( 8178):   at 
 com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
 E/WindowManager( 8178):   at 
 android.os.Handler.dispatchMessage(Handler.java:102)
 E/WindowManager( 8178):   at android.os.Looper.loop(Looper.java:136)
 E/WindowManager( 8178):   at 
 android.app.ActivityThread.main(ActivityThread.java:5017)
 E/WindowManager( 8178):   at java.lang.reflect.Method.invokeNative(Native 
 Method)