Skip to content

manager: fix TransactionTooLargeException crash on large module install logs#1491

Open
YangQi0408 wants to merge 1 commit into
bmax121:mainfrom
YangQi0408:fix/install-log-crash
Open

manager: fix TransactionTooLargeException crash on large module install logs#1491
YangQi0408 wants to merge 1 commit into
bmax121:mainfrom
YangQi0408:fix/install-log-crash

Conversation

@YangQi0408

Copy link
Copy Markdown
Contributor

When installing modules that produce large log output (e.g. theme modules with thousands of icons), the install log text state grows unboundedly, causing TransactionTooLargeException when the Activity's saved state Bundle exceeds the Binder transaction limit (~1MB).

This was previously reported in #927 and fixed in cb684e6 by switching from rememberSaveable to remember, but that caused the log to reset on navigation (#1308).

Fix both issues by:

  • Using rememberSaveable for text state (preserves log on navigation)
  • Truncating text at runtime to 100K chars when it exceeds the limit
  • Keeping full log in StringBuilder (remember) for saving to file
  • Also fixing ExecuteAPMActionScreen which had the same issue

The 100K char limit (~100KB) is well below the Binder limit and still covers ~2000-3000 lines of install log output.

Closes: #927

…ll logs

When installing modules that produce large log output (e.g. theme
modules with thousands of icons), the install log text state grows
unboundedly, causing TransactionTooLargeException when the Activity's
saved state Bundle exceeds the Binder transaction limit (~1MB).

This was previously reported in bmax121#927 and fixed in cb684e6 by switching
from rememberSaveable to remember, but that caused the log to reset
on navigation (bmax121#1308).

Fix both issues by:
- Using rememberSaveable for text state (preserves log on navigation)
- Truncating text at runtime to 100K chars when it exceeds the limit
- Keeping full log in StringBuilder (remember) for saving to file
- Also fixing ExecuteAPMActionScreen which had the same issue

The 100K char limit (~100KB) is well below the Binder limit and still
covers ~2000-3000 lines of install log output.

Closes: bmax121#927
@YangQi0408

Copy link
Copy Markdown
Contributor Author

test_biglog_module.zip

a module for test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App crash after flash a module

1 participant