You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a video is opened from a channel page and the user presses Back to leave the player, a second, fresh channel activity is launched on top of the existing one. The user then has to
press Back twice to leave the channel (the first Back dismisses the duplicate channel page, which
looks identical to the one beneath it).
Repro (on v0.4.2-beta.7+st31.94, device R3GL3069JMZ):
Subscriptions → Channels → tap a channel (Channel page opens)
Tap a video in that channel (player opens, plays)
Back → returns to the channel page ✓
Back → shows the same channel page again (the duplicate) ✗ — expected to return to the Channels list
Back → returns to the Channels list
Root cause
MobilePlaybackActivity.onBackPressed() (the #23 fix) calls finishReally(). The inherited LeanbackActivity.finishReally() calls getViewManager().startParentView(this) before finishing
(smarttubetv/src/main/.../tv/ui/common/LeanbackActivity.java:131). startParentView
(common/.../app/views/ViewManager.java:132) launches the parent (channel) via a plain new Intent(activity, MobileChannelActivity). MobileChannelActivity is launchMode=singleTop,
which only reuses an instance that is already at the top of the task — but the original channel
sits beneath the player (in a separate task), so a new MobileChannelActivity is created.
Activity trace confirming the second channel launch on Back:
START ... MobileChannelActivity (tap channel)
START ... MobilePlaybackActivity (tap video)
START ... MobileChannelActivity (~Back from player — the duplicate)
Every finish() / finishReally() branch except the bare super.finish() calls startParentView, so there is no trivial stmobile-only one-liner.
Severity: minor (one extra Back; no crash, no data loss, no lingering audio).
Fix options (to scope)
Shared (clean, but mergeability cost): make ViewManager.startParentView reuse an existing
parent instance (e.g. moveTaskToFront / FLAG_ACTIVITY_REORDER_TO_FRONT/CLEAR_TOP) instead
of always starting a new one. Touches common → weigh upstream-merge impact.
stmobile-only workaround: have MobilePlaybackActivity.onBackPressed stop playback and finishAndRemoveTask() directly (bypassing startParentView) so the player's task is removed
and the system returns to the channel's task; or give MobileChannelActivity a singleTask
launch mode. Both risk regressing [BUG]: Player <-> channel Back loop with lingering audio #23's PIP / background-audio paths and need device testing.
Deferred from the beta.7 release (shipped as-is; beta.7 is strictly better than beta.6).
Summary
When a video is opened from a channel page and the user presses Back to leave the player, a
second, fresh channel activity is launched on top of the existing one. The user then has to
press Back twice to leave the channel (the first Back dismisses the duplicate channel page, which
looks identical to the one beneath it).
Repro (on
v0.4.2-beta.7+st31.94, device R3GL3069JMZ):Root cause
MobilePlaybackActivity.onBackPressed()(the #23 fix) callsfinishReally(). The inheritedLeanbackActivity.finishReally()callsgetViewManager().startParentView(this)before finishing(
smarttubetv/src/main/.../tv/ui/common/LeanbackActivity.java:131).startParentView(
common/.../app/views/ViewManager.java:132) launches the parent (channel) via a plainnew Intent(activity, MobileChannelActivity).MobileChannelActivityislaunchMode=singleTop,which only reuses an instance that is already at the top of the task — but the original channel
sits beneath the player (in a separate task), so a new
MobileChannelActivityis created.Activity trace confirming the second channel launch on Back:
Every
finish()/finishReally()branch except the baresuper.finish()callsstartParentView, so there is no trivial stmobile-only one-liner.Notes
finish()path also calledstartParentView(duplicate channel) and kept the engine alive (audio loop). [BUG]: Player <-> channel Back loop with lingering audio #23 fixed theaudio loop; this duplicate-channel remainder became visible once Back actually leaves.
Fix options (to scope)
ViewManager.startParentViewreuse an existingparent instance (e.g.
moveTaskToFront/FLAG_ACTIVITY_REORDER_TO_FRONT/CLEAR_TOP) insteadof always starting a new one. Touches
common→ weigh upstream-merge impact.MobilePlaybackActivity.onBackPressedstop playback andfinishAndRemoveTask()directly (bypassingstartParentView) so the player's task is removedand the system returns to the channel's task; or give
MobileChannelActivityasingleTasklaunch mode. Both risk regressing [BUG]: Player <-> channel Back loop with lingering audio #23's PIP / background-audio paths and need device testing.
Deferred from the beta.7 release (shipped as-is; beta.7 is strictly better than beta.6).