Skip to content

Don't crash when settings open before Backtalk has connected - #226

Merged
aryanchoudharypro merged 2 commits into
trypsynth:masterfrom
aaron-gh:exit-controller-before-connect
Oct 20, 2026
Merged

aryanchoudharypro merged 2 commits into
trypsynth:masterfrom
aaron-gh:exit-controller-before-connect

Conversation

@aaron-gh

Copy link
Copy Markdown
Contributor

Opening Backtalk's settings just after Backtalk is updated or restarted could crash it with a NullPointerException:

TalkBackService.getTalkBackExitController
TalkBackPreferenceFragment.disableTalkBackExitWatermark
TalkBackPreferenceFragment.onResume

TalkBackService.getInstance() returns the service from onCreate, but the service's pipeline is only made in onServiceConnected. The settings screen can resume in between. getTalkBackExitController then made the controller from the null pipeline.

getTalkBackExitController now returns null until the service is connected. TalkBackPreferenceFragment and ListMenuManager already handle null. reloadPreferences now does too.

Tested:

  • Seen on an Android 17 emulator when settings opened right after Backtalk was reinstalled.
  • A unit test checks that the service has no controller before it is connected. Without the fix, it fails with the same NullPointerException.
  • The same reinstall-then-open sequence didn't crash in two runs after the fix. The logs don't show whether those runs hit the same timing.

aaron-gh and others added 2 commits October 19, 2026 20:32
Opening Backtalk's settings just after it was updated or restarted could
crash it. The settings screen asks the service for its exit watermark
controller as it opens, and the service made one from its pipeline,
which doesn't exist until the service is connected.

The service now has no exit watermark controller until it is connected,
and its callers already handle that.

- Unit test for the controller before the service is connected.
@aryanchoudharypro
aryanchoudharypro merged commit a836057 into trypsynth:master Oct 20, 2026
2 checks passed
mad-gamer26 added a commit to mad-gamer26/BacktalkRemote that referenced this pull request Oct 20, 2026
Brings in the keyboard-safe text fields (trypsynth#225), which also cover the
remote access key and relay server dialogs through the replaced
EditTextPreference layout, settings that open before Backtalk has
connected (trypsynth#226), and the fresh reading order search (trypsynth#221).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SKArzG82mfYh483GfqQKFo
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.

2 participants