Status Update
Comments
jo...@google.com <jo...@google.com> #2
still here in r14
I believe there is an error in the bug description.
the Expected results would be a return value of false.
but what one gets is a true value instead.
it seems to affect all android versions.
interesting fact:
the "Camera Support" property (hw.camera) defaults to 'no'.
but yet every AVD I tried so far has a camera app and it is even working quite well.
just so as one would expect if the AVD would have hw.camera=yes.
I tried AVDs with explicitly turning off an on the camera support but they behaved exactly the same way.
this is quit frustrating if you want to write an app, that could optionally use a camera but also works on devices without a camera.
ok, there are few devices without camera but it would be nice to test what happens if the app is used on such a device.
I believe there is an error in the bug description.
the Expected results would be a return value of false.
but what one gets is a true value instead.
it seems to affect all android versions.
interesting fact:
the "Camera Support" property (hw.camera) defaults to 'no'.
but yet every AVD I tried so far has a camera app and it is even working quite well.
just so as one would expect if the AVD would have hw.camera=yes.
I tried AVDs with explicitly turning off an on the camera support but they behaved exactly the same way.
this is quit frustrating if you want to write an app, that could optionally use a camera but also works on devices without a camera.
ok, there are few devices without camera but it would be nice to test what happens if the app is used on such a device.
Description
Reproducible on new projects created by AS 3.1 RC1 and AS 3.2 Canary 4.
Build: 3.1 RC 1, AI-173.4625007, 201802272218, AI-173.4625007, JRE 1.8.0_152-release-1024-b01x64 JetBrains s.r.o, OS Linux(amd64) v4.13.0-36-generic unknown, screens 2560x1440, 1920x1080
Android Gradle Plugin: 3.1.0-rc01
Gradle: 4.4
NDK: from local.properties: (not specified); latest from SDK: (not found); LLDB: pinned revision 3.1 not found; latest from SDK: (package not found); CMake: from local.properties: (not specified); latest from SDK: (not found); from PATH: (not found);
Repro steps:
1. File > New > Project, accepting defaults (add kotlin support, add blank activity, min SDK 19, etc)
2. Add an EditText to the generated layout file after the TextView (activity_main.xml):
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />
3. Edit the generated "App" run configuration and tick Profiling tab > "Enable advanced profiling (required for API level < 26 only)".
4. Run this project on an API 23 AVD (I used Nexus 4).
5. In the emulator, click in the EditText to focus it.
Note main thread hangs and app crashes after a few seconds.
Expect app not to crash.
Logcat output:
03-08 15:09:12.161 4270-4270/com.example.profilercrashdemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.profilercrashdemo, PID: 4270
java.lang.StackOverflowError: stack size 8MB
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
...
03-08 15:09:12.409 4270-4270/com.example.profilercrashdemo E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 34875836)
03-08 15:09:12.409 4270-4270/com.example.profilercrashdemo E/AndroidRuntime: Error reporting crash
android.os.TransactionTooLargeException: data parcel size 34875836 bytes
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:503)
at android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4425)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:90)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
Setting a method breakpoint on android.view.inputmethod.InputConnectionWrapper#getSelectedText, the stacktrace is:
"main@3973" prio=5 runnable
java.lang.Thread.State: RUNNABLE
at android.view.inputmethod.InputConnectionWrapper.getSelectedText(InputConnectionWrapper.java:54)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:241)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Method.java:-1)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I can see the mTarget field refers to this, and breakpointing on field modification I can see it is set by com.android.tools.profiler.support.profilers.EventProfiler$InputConnectionHandler.