Custom launcher black screen on HOME key
-
I'm debugging an issue with android > 7 (didn't manage to get the issue on android 6), where an application built as a launcher would result in a black screen on home key press.
I created a simple QtQuick application, with just an
ApplicationWindow
and aRectangle
, nothing special, just to have something visual.
InAndroidManifest.xml
(generated by Qt), I added :<intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.HOME"/> <category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LEANBACK_LAUNCHER"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter>
and set
android:launchMode
to"singleInstance"
(also triedsingleTask
).Tried building the app with:
Qt 5.12.5/15.13.2/5.15.1
,NDK 19/21
and in 99% of the builds I just get a black screen when pressing home key.
There are some rare cases where the home key works and it will open the launcher as it should (after manually launching another activity) , when that happens it keeps working till I reinstall it again.I can't find any solution to this issue, or what could be the possible reason that in rare cases it works. Only thing I could conclude so far is that there must be a difference in execution order when the application is launched.
This are the adb logs when I launch Youtube then press home key:
09-10 14:29:05.229 4531 4600 I chromium: [4531:4600:INFO:mdns_app_filter.cc(1531)] MdnsAppFilter: Done announcing. 09-10 14:29:07.087 3184 3298 E TaskPersister: File error accessing recents directory (directory doesn't exist?). 09-10 14:29:07.839 13637 13637 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:29:07.859 13637 13637 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:29:07.860 13637 13637 I AVUtils : Opened libavenhancements.so 09-10 14:29:07.860 13637 13637 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:29:07.860 13637 13637 I AVUtils : CREATE function success 09-10 14:29:07.860 13637 13637 I AVUtils : Opened libavenhancements.so 09-10 14:29:07.860 13637 13637 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:29:07.860 13637 13637 I AVUtils : CREATE function success 09-10 14:29:07.865 13637 13637 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:29:07.865 13637 13637 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:29:07.865 13637 13637 I AVUtils : CREATE function success 09-10 14:29:07.868 13637 13637 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<< 09-10 14:29:08.255 13637 13637 W app_process: Using default instruction set features for ARM CPU variant (cortex-a9) using conservative defaults 09-10 14:29:08.268 13637 13637 I app_process: The ClassLoaderContext is a special shared library. 09-10 14:29:08.376 13637 13637 D AndroidRuntime: Calling main entry com.android.commands.input.Input 09-10 14:29:08.377 13637 13637 I Input : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_HOME, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=9786662, downTime=9786662, deviceId=-1, source=0x101 } 09-10 14:29:08.382 13637 13637 I Input : injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_HOME, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=9786662, downTime=9786662, deviceId=-1, source=0x101 } 09-10 14:29:08.387 3184 3261 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity (has extras)} from uid 1000 09-10 14:29:08.407 3328 3328 I vol.Events: writeEvent dismiss_dialog volume_controller 09-10 14:29:08.413 13567 13567 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@ce7a413 09-10 14:29:08.420 13637 13637 D AndroidRuntime: Shutting down VM 09-10 14:29:08.446 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:29:08.494 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:29:08.494 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:29:08.641 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:29:08.642 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:29:08.646 13567 13567 E Qt JAVA : Surface 1 not found! 09-10 14:29:08.652 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:29:08.655 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:29:08.663 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:29:08.663 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:29:08.673 3318 3318 I GoogleInputMethodService: GoogleInputMethodService.onFinishInput():3160 09-10 14:29:08.679 3318 3318 I GoogleInputMethodService: GoogleInputMethodService.onStartInput():1829 09-10 14:29:08.727 3184 3290 W HdmiCecController: Failed to send <Text View On> src: 4, dst: 0 with errorCode=1 09-10 14:29:08.743 3184 3207 I ActivityManager: Displayed org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity: +310ms (total +5s740ms) 09-10 14:29:08.903 3004 4033 W SurfaceFlinger: Attempting to set client state on removed layer: Splash Screen org.qtproject.testlauncher#0 09-10 14:29:08.903 3004 4033 W SurfaceFlinger: Attempting to destroy on removed layer: Splash Screen org.qtproject.testlauncher#0 09-10 14:29:08.925 7169 7169 I starboard: Prepare to suspend 09-10 14:29:08.926 7169 7169 I starboard_media: Media focus: none 09-10 14:29:08.927 4531 4531 D WargCastTvAppManager: com.google.android.youtube.tv's active state now is : false 09-10 14:29:08.927 4531 4531 D WargCastTvAppManager: Cast TV app is inactive now: com.google.android.youtube.tv 09-10 14:29:08.927 4531 4531 D WargCastTvAppManager: Cast TV app is disconnected now: com.google.android.youtube.tv 09-10 14:29:08.938 4531 4531 D WargServiceStub: TV app is closed: com.google.android.libraries.cast.tv.warg.service.internal.CastTvApp@bfa4d3f 09-10 14:29:08.939 4531 4531 I chromium: [4531:4531:INFO:application_manager_impl.cc(1532)] App stopping: AndroidNativeApp (YouTube), session_id=e0898d4e-696d-4ffb-aed7-910ddceb8a24 09-10 14:29:08.939 4531 4531 I chromium: [4531:4531:INFO:application_manager_impl.cc(1536)] App stopped: AndroidNativeApp (YouTube), session_id=e0898d4e-696d-4ffb-aed7-910ddceb8a24 09-10 14:29:08.940 4531 4531 I chromium: [4531:4531:INFO:resource_manager_impl.cc(244)] All resources released for app AndroidNativeApp (YouTube), session_id=e0898d4e-696d-4ffb-aed7-910ddceb8a24 09-10 14:29:08.940 4531 4531 E chromium: [4531:4531:ERROR:hash_util.cc(101)] Unknown app_id AndroidNativeApp 09-10 14:29:08.940 4531 4531 E chromium: [4531:4531:ERROR:cast_metrics_helper.cc(129)] No start time for app: app_id=E8C28D3C 09-10 14:29:08.940 4531 4531 I chromium: [4531:4531:INFO:application_manager_impl.cc(1791)] Focusing foreground application: session=312d0999-4abe-4b47-b2d4-6a0a87f460f7 09-10 14:29:08.941 4531 4531 I chromium: [4531:4531:INFO:api_reboot.cc(286)] active_activities count=0 09-10 14:29:08.941 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=local-client.457): CastV2.Connection.Connect.In 09-10 14:29:08.941 4531 4531 E chromium: [4531:4531:ERROR:media_classifier_manager.cc(89)] No mixer control available 09-10 14:29:08.942 4531 4531 W chromium: [4531:4531:WARNING:media_control_handler.cc(49)] Unknown player state: 09-10 14:29:08.943 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=local-client.458): CastV2.Connection.Connect.In 09-10 14:29:08.943 4531 4531 D cr_CastToNative: [NativeApplication.java:224] onDestroyed 09-10 14:29:08.944 4531 4600 I chromium: [4531:4600:INFO:mdns_cast_service.cc(780)] Device discovery state is idle 09-10 14:29:08.947 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.456): CastV2.Connection.Close.Out 09-10 14:29:08.948 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.70): CastV2.Connection.Close.Out 09-10 14:29:08.948 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.70): CastV2.Connection.Close.Out 09-10 14:29:08.949 4531 4601 E chromium: [4531:4601:ERROR:v2_transport.cc(1018)] Invalid connection: e0898d4e-696d-4ffb-aed7-910ddceb8a24:local-client.455:mediacontrol-0 09-10 14:29:08.949 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=local-client.455): CastV2.Connection.Close.Out 09-10 14:29:08.949 4531 4601 I chromium: [4531:4601:INFO:v2_transport.cc(472)] Removed Cast V2 endpoint: id=e0898d4e-696d-4ffb-aed7-910ddceb8a24 09-10 14:29:08.950 4531 4601 I chromium: [4531:4601:INFO:v2_transport.cc(1212)] Heartbeat for V2TransportImpl stopping 09-10 14:29:09.067 4531 4601 E chromium: [4531:4601:ERROR:connection_namespace_handler.cc(214)] Connection not found: e0898d4e-696d-4ffb-aed7-910ddceb8a24:ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.456:com.google.android.gms-308 09-10 14:29:09.070 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.456): CastV2.Connection.Close.In.NotFound 09-10 14:29:09.108 4531 4601 I chromium: [4531:4601:INFO:v2_ssl_socket.cc(356)] Stop reading on pending closed socket 09-10 14:29:09.180 7169 7169 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs. 09-10 14:29:09.208 3184 3290 W HdmiCecController: Failed to send <Give Device Power Status> src: 4, dst: 0 with errorCode=1 09-10 14:29:09.194 7169 7169 I chatty : uid=10041(com.google.android.youtube.tv) identical 4 lines 09-10 14:29:09.197 7169 7169 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs. 09-10 14:29:09.307 7309 7317 W System : A resource failed to call close. 09-10 14:29:09.354 3184 3193 I system_server: Background concurrent copying GC freed 30729(1568KB) AllocSpace objects, 9(372KB) LOS objects, 19% free, 8MB/10MB, paused 326us total 204.430ms 09-10 14:29:09.398 7169 7240 W ProxyAndroidLoggerBackend: Too many Flogger logs received before configuration. Dropping old logs.
I believe this is the main issue
E Qt JAVA : Surface 1 not found!
as it's not outputted in case when the home key works.Then there is this case when I just press home key while having only launcher open:
09-10 14:35:43.408 14291 14291 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:35:43.418 14291 14291 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:35:43.418 14291 14291 I AVUtils : Opened libavenhancements.so 09-10 14:35:43.419 14291 14291 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:35:43.419 14291 14291 I AVUtils : CREATE function success 09-10 14:35:43.419 14291 14291 I AVUtils : Opened libavenhancements.so 09-10 14:35:43.419 14291 14291 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:35:43.419 14291 14291 I AVUtils : CREATE function success 09-10 14:35:43.419 14291 14291 I AVUtils : createInstance(32bit) : _ZN7android19createExtendedUtilsEv 09-10 14:35:43.419 14291 14291 I AVUtils : symbol _ZN7android19createExtendedUtilsEv found: (null) 09-10 14:35:43.419 14291 14291 I AVUtils : CREATE function success 09-10 14:35:43.419 14291 14291 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<< 09-10 14:35:43.484 4531 4600 I chromium: [4531:4600:INFO:mdns_app_filter.cc(2604)] MdnsAppFilter: responses sent in 40 seconds: 8 09-10 14:35:43.645 14291 14291 W app_process: Using default instruction set features for ARM CPU variant (cortex-a9) using conservative defaults 09-10 14:35:43.650 14291 14291 I app_process: The ClassLoaderContext is a special shared library. 09-10 14:35:43.718 14291 14291 D AndroidRuntime: Calling main entry com.android.commands.input.Input 09-10 14:35:43.719 14291 14291 I Input : injectKeyEvent: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_HOME, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=10182003, downTime=10182003, deviceId=-1, source=0x101 } 09-10 14:35:43.723 14291 14291 I Input : injectKeyEvent: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_HOME, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=10182003, downTime=10182003, deviceId=-1, source=0x101 } 09-10 14:35:43.727 3328 3328 I vol.Events: writeEvent dismiss_dialog volume_controller 09-10 14:35:43.728 3184 3261 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity (has extras)} from uid 1000 09-10 14:35:43.729 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.482): CastV2.Connection.Connect.In 09-10 14:35:43.747 14291 14291 D AndroidRuntime: Shutting down VM 09-10 14:35:43.751 4531 4601 E chromium: [4531:4601:ERROR:v2_transport.cc(853)] Not supported namespace: namespace=urn:x-cast:com.google.cast.multizone, conn=receiver-ad21cedb-cca5-1e11-0a29-1be0dd74fbc7:ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.482:com.google.android.gms-334 09-10 14:35:43.777 14155 14155 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@1336c23 09-10 14:35:43.781 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:35:43.781 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:35:43.804 4531 4601 I chromium: [4531:4601:INFO:v2_ssl_socket.cc(356)] Stop reading on pending closed socket 09-10 14:35:43.821 2987 3068 I [Gralloc]: framebuffer hal alread move to hwcomposer 09-10 14:35:43.821 2987 3068 E gralloc : ioctl c0144900 failed with code -1: Operation not permitted 09-10 14:35:43.912 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.912 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.913 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.913 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.914 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.915 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.915 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.918 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.919 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.920 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.920 14155 14195 W libtestlauncher.so: QEGLPlatformContext: eglSwapBuffers failed: 300d 09-10 14:35:43.921 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.921 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.921 3004 3053 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.922 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.924 3004 3259 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.924 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.924 3004 3056 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.925 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.925 3004 3259 E BufferQueueProducer: [SurfaceView - org.qtproject.testlauncher/org.qtproject.qt5.android.bindings.QtActivity#0] dequeueBuffer: BufferQueue has been abandoned 09-10 14:35:43.926 14155 14195 E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3 09-10 14:35:43.926 14155 14195 W libtestlauncher.so: QEGLPlatformContext: eglSwapBuffers failed: 300d 09-10 14:35:44.069 3184 3290 W HdmiCecController: Failed to send <Text View On> src: 4, dst: 0 with errorCode=1 09-10 14:35:44.548 3184 3290 W HdmiCecController: Failed to send <Give Device Power Status> src: 4, dst: 0 with errorCode=1 09-10 14:35:46.135 4531 4601 I chromium: [4531:4601:INFO:metrics_recorder.cc(261)] Cast v2 action(socket_id=ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.483): CastV2.Connection.Connect.In 09-10 14:35:46.154 4531 4601 E chromium: [4531:4601:ERROR:v2_transport.cc(853)] Not supported namespace: namespace=urn:x-cast:com.google.cast.multizone, conn=receiver-ad21cedb-cca5-1e11-0a29-1be0dd74fbc7:ad21cedb-cca5-1e11-0a29-1be0dd74fbc7.483:com.google.android.gms-335 09-10 14:35:46.172 4531 4601 I chromium: [4531:4601:INFO:v2_ssl_socket.cc(356)] Stop reading on pending closed socket
Different behaviour, but I guess the main issue here is
E [EGL-ERROR]: __egl_platform_dequeue_buffer:1817: failed to dequeue buffer from native window 0xd21a0808; err = -19, buf = 0x0,max_allowed_dequeued_buffers 3
Is there any way to fix this, as it seems like an Android/Qt issue? I'm all out of ideas what to try any more.