WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Possible blocking issues on the UI thread #82

@nbd-boss

Description

@nbd-boss

Description:

HardwareBufferSurfaceView.kt

  • In render(), the method initGLES() is called synchronously.
  • initGLES() contains heavy GLES/EGL initialization logic that may block the UI thread, potentially causing jank or dropped frames.
  • According to Android official guidelines, GPU/EGL/GLES initialization should not be performed on the UI thread to avoid frame drops or ANRs.

GUIConfigActivity.kt

  • In onPause(), the method save() synchronously writes settings using SharedPreferences.commit().
  • Synchronous commit may block the UI thread. It is recommended to use apply() for asynchronous writes to improve responsiveness.

GUIWidgetConfigurationActivity.kt

  • In onCreate(), getIDMappingPrefs() is called synchronously.
  • EncryptedSharedPreferences.create() inside this method can be time-consuming, as reported by multiple developers on StackOverflow.
  • To avoid blocking the UI thread, this initialization should be moved off the main thread.
  • Additionally, any commit() calls should be replaced with apply() to prevent potential UI blocking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions