Background
PR #1563 fixed an issue where HomeActivity.onBackPressed() was silently bypassed on Android 13+ (API 33+) because modern Android routes back presses through WindowOnBackInvokedDispatcher → AndroidX OnBackPressedDispatcher, whose fallback calls ComponentActivity.super.onBackPressed() directly — skipping subclass overrides.
The same bug is likely present in other activities still using the deprecated onBackPressed() override pattern.
Affected files
onebusaway-android/src/main/java/org/onebusaway/android/ui/TripPlanActivity.java:261-267 — Has panel-collapse logic identical in shape to the HomeActivity bug; this is almost certainly broken on Android 13+.
onebusaway-android/src/main/java/org/onebusaway/android/report/ui/InfrastructureIssueActivity.java:722-726 — Resets mServicesSpinner after back; this side-effect is being skipped on Android 13+.
(SurveyViewUtils.java:148 uses onBackPressed() on a BottomSheetDialog, which is a separate dispatcher path — out of scope for this issue.)
Fix
Migrate each onBackPressed() override to register an OnBackPressedCallback with getOnBackPressedDispatcher() in onCreate(), mirroring the pattern from #1563.
Reference: https://developer.android.com/guide/navigation/custom-back
Background
PR #1563 fixed an issue where
HomeActivity.onBackPressed()was silently bypassed on Android 13+ (API 33+) because modern Android routes back presses throughWindowOnBackInvokedDispatcher→ AndroidXOnBackPressedDispatcher, whose fallback callsComponentActivity.super.onBackPressed()directly — skipping subclass overrides.The same bug is likely present in other activities still using the deprecated
onBackPressed()override pattern.Affected files
onebusaway-android/src/main/java/org/onebusaway/android/ui/TripPlanActivity.java:261-267— Has panel-collapse logic identical in shape to theHomeActivitybug; this is almost certainly broken on Android 13+.onebusaway-android/src/main/java/org/onebusaway/android/report/ui/InfrastructureIssueActivity.java:722-726— ResetsmServicesSpinnerafter back; this side-effect is being skipped on Android 13+.(
SurveyViewUtils.java:148usesonBackPressed()on aBottomSheetDialog, which is a separate dispatcher path — out of scope for this issue.)Fix
Migrate each
onBackPressed()override to register anOnBackPressedCallbackwithgetOnBackPressedDispatcher()inonCreate(), mirroring the pattern from #1563.Reference: https://developer.android.com/guide/navigation/custom-back