New issue
Advanced search Search tips

Issue 647823 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Sep 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

[Android][Client] App crashes when going into split-screen mode

Project Member Reported by joedow@chromium.org, Sep 16 2016

Issue description

This appears to be a recent regression as this functionality worked a few weeks ago.

Repro Steps:
1.) Start the app on an Android N device
2.) Bring up the navigation bar
3.) Press and hold the task switcher button (to enter split-screen mode)
4.) App crashes

Stack trace:
--------- beginning of crash
09-16 14:37:59.722  5234  5234 E AndroidRuntime: FATAL EXCEPTION: main
09-16 14:37:59.722  5234  5234 E AndroidRuntime: Process: org.chromium.chromoting, PID: 5234
09-16 14:37:59.722  5234  5234 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.chromium.chromoting/org.chromium.chromoting.Desktop}: android.view.InflateException: Binary XML file line #35: Attempt to invoke interface method 'void org.chromium.chromoting.RenderStub.setDesktopView(org.chromium.chromoting.DesktopView)' on a null object reference
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4483)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.-wrap19(ActivityThread.java)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1466)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6077)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: Caused by: android.view.InflateException: Binary XML file line #35: Attempt to invoke interface method 'void org.chromium.chromoting.RenderStub.setDesktopView(org.chromium.chromoting.DesktopView)' on a null object reference
09-16 14:37:59.722  5234  5234 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void org.chromium.chromoting.RenderStub.setDesktopView(org.chromium.chromoting.DesktopView)' on a null object reference
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at org.chromium.chromoting.DesktopView.onAttachedToWindow(DesktopView.java:58)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.View.dispatchAttachedToWindow(View.java:15391)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2960)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.ViewGroup.addViewInner(ViewGroup.java:4493)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.ViewGroup.addView(ViewGroup.java:4295)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.ViewGroup.addView(ViewGroup.java:4267)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:527)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:280)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at org.chromium.chromoting.Desktop.onCreate(Desktop.java:85)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:6664)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4483)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.-wrap19(ActivityThread.java)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1466)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:102)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:154)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6077)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
09-16 14:37:59.722  5234  5234 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
09-16 14:37:59.725  1090  1817 W ActivityManager:   Force finishing activity org.chromium.chromoting/.Desktop
09-16 14:37:59.787  1090  1228 I OpenGLRenderer: Initialized EGL, version 1.4
09-16 14:37:59.787  1090  1228 D OpenGLRenderer: Swap behavior 2

 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/410a599d9d3c9e49d3b77dbc1063938981fb5b30

commit 410a599d9d3c9e49d3b77dbc1063938981fb5b30
Author: yuweih <yuweih@chromium.org>
Date: Sat Sep 17 00:23:35 2016

[Remoting Android] Fix split-screen crash

Previously we assumed that DestopView.onAttachedToWindow() will only be called
after DesktopView.init() is called but this is not true when we enter split
screen mode. Since the lifecycle of View.onAttached... and View.onDetached in
relate to Activity.onCreate() and Activity.onDestroy() is not well documented
and behaves quite surprisingly, it may be better to just rely on the lifecycle
of the activity itself.

This CL removes DesktopView's onAttachedToWindow() and onDetachedFromWindow()
overrides and handles initialization and invalidation by Desktop's onCreate()
and onDestroy().

BUG= 647823 

Review-Url: https://codereview.chromium.org/2348563004
Cr-Commit-Position: refs/heads/master@{#419343}

[modify] https://crrev.com/410a599d9d3c9e49d3b77dbc1063938981fb5b30/remoting/android/java/src/org/chromium/chromoting/Desktop.java
[modify] https://crrev.com/410a599d9d3c9e49d3b77dbc1063938981fb5b30/remoting/android/java/src/org/chromium/chromoting/DesktopView.java

Comment 2 by yuweih@chromium.org, Sep 17 2016

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)
After reproducing the crash with builds from the last week, I have verified that this crash no longer occurs on 55.0.2867.0

Sign in to add a comment