Skip to content

fix: prevent stale companion controls after teardown#143

Merged
papi-ux merged 1 commit into
masterfrom
audit/v1.3.2-companion-lifecycle
Jul 13, 2026
Merged

fix: prevent stale companion controls after teardown#143
papi-ux merged 1 commit into
masterfrom
audit/v1.3.2-companion-lifecycle

Conversation

@papi-ux

@papi-ux papi-ux commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Prevents stale Nova companion controls from surviving or reopening after stream teardown.

  • marks the stream inactive before asynchronous teardown begins;
  • synchronously dismisses the companion notification and Presentation when streaming stops;
  • dispatches delayed display/notification reopen requests to the UI thread;
  • re-evaluates the live stream/activity lifecycle tuple at execution time;
  • blocks companion controls when the stream is inactive or Game is finishing/destroyed;
  • preserves partial-Presentation cleanup and API 21 compatibility.

Lifecycle contract

CompanionControlLifecyclePolicy.canShow(...) allows companion controls only when all three live conditions hold:

isStreamActive == true
isFinishing() == false
isDestroyed == false

The decision is made on the UI thread when the queued reopen callback executes, rather than using stale state captured when the request was queued.

Verification

Reviewed commit:

093605e237773d63259e4c3f79247991bb09e045

Exact reviewed binary-diff SHA-256:

3b2739cc670d169c3bab4d1628aaa42824fd481533b8bf18bb2ea48dfe50a228

Base/current origin/master at freeze:

481e2eb5c42904690bc3164aa4b6a8a94801f432

Fresh pc-papi gates:

  • Root JVM suite: 786/786 passed
  • Non-root JVM suite: 780/780 passed
  • Helper/onboarding suite: 51/51 passed
  • Root fail-on-error lint: passed
  • Non-root fail-on-error lint: passed
  • ARM64 unsigned release APK assembly: passed
  • ARMv7 unsigned release APK assembly: passed
  • x86_64 unsigned release APK assembly: passed
  • Live-tuple-to-permissive-constants compiling mutation: RED
  • Restored focused lifecycle source guard: GREEN
  • Added-production-line security/privacy scan: 0 findings
  • Fresh exact-hash fail-closed review: passed with no blockers
  • Post-commit diff reproduced the exact reviewed SHA-256

Unsigned APK metadata:

ABI Package Version Version code
arm64-v8a com.papi.nova 1.3.1 33
armeabi-v7a com.papi.nova 1.3.1 33
x86_64 com.papi.nova 1.3.1 33

Scope boundary

This PR does not install an APK, claim Retroid/Thor hardware validation, publish a release, or deploy/restart Polaris. Physical Thor remains a separate v1.3.2 release gate.

@papi-ux
papi-ux merged commit 61b34ce into master Jul 13, 2026
6 checks passed
@papi-ux
papi-ux deleted the audit/v1.3.2-companion-lifecycle branch July 13, 2026 12:55
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.

1 participant