Skip to content

fix(android): guard network callback cleanup for API 21 - #372

Merged
papi-ux merged 1 commit into
masterfrom
review/nova-api21-cleanup-20261020
Oct 20, 2026
Merged

papi-ux merged 1 commit into
masterfrom
review/nova-api21-cleanup-20261020

Conversation

@papi-ux

@papi-ux papi-ux commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

The first master build of 1.5.0-beta.2 stopped in Android lint (Lint and unit test):

NovaGameDetailActivity.kt:597: Error: Call requires API level 23 (current min is 21): android.content.Context#getSystemService [NewApi]

registerNetworkChangeCallback already returns below Android 7.0 (API 24), and it is the only place networkChangeCallback is set. Cleanup therefore never reached the typed getSystemService call on older devices, but lint cannot see that field invariant. Cleanup now takes and clears the callback exactly as before, then makes the same SDK_INT < N check explicit before asking for ConnectivityManager.

  • API 24 and newer: cleanup unregisters the callback that registration added, exactly as before.
  • API 21 to 23: registration never sets the callback, so cleanup still returns at the null check and never reaches the new line.
  • Unchanged: minSdk stays 21. There is no lint suppression, @TargetApi, baseline or lintFailOnError change.

Steam Frame alpha. This workflow never builds the Frame bundle. The bundle qualified from 5dd0cf58 is attached to the draft release first, and a tag build checks it against pinned digests. That check refuses the tag if any path outside RELEASE_ONLY changed since 5dd0cf58.

  • This activity is Android code. The Frame bundle is built from clients/deck with CMake and does not compile it, so RELEASE_ONLY gains exactly this one path.
  • The Frame source, tree, bundle digest, size and runtime pins are unchanged.
  • NovaReleaseMetadataTest adds three cases:
    • an activity-only change passes;
    • a near-name file (NovaGameDetailActivity.kt.orig) is refused before any release call;
    • another Android source (NovaLibraryActivity.kt) is refused before any release call.

CHANGELOG.md and the 1.5.0 release notes are unchanged.

Exact candidate

Head 7cc76a2068bb7ccff4b92b280fc7691a53915d9c, tree 958017de9563b8fd40620f660973c8f363a68f27
Base master at bbb8095eefd0dbd6de9412ea1506e92ab0f437aa, the head's parent
Files app/src/main/java/com/papi/nova/ui/NovaGameDetailActivity.kt (+2), .github/workflows/build.yml (+1), app/src/test/java/com/papi/nova/NovaReleaseMetadataTest.kt (+15/-1)

Preserve this commit when merging; do not squash or rebase. The v1.5.0-beta.2 tag will target the exact candidate above.

Verification

  • Frame release controls: the controls embedded in NovaReleaseMetadataTest, run directly with Python, pass all 30 cases on this tree (27 existing, 3 new). Against the previous workflow, the activity-only case is refused, so the new cases detect the change.
  • Frame diff: git diff --no-renames --name-only 5dd0cf58 7cc76a20 lists 14 paths, all inside the new RELEASE_ONLY set.
  • Not run locally: Android lint, the JVM tests and the APK build. Android lint must pass in this PR. The signed APK is built and checked by the subsequent master and tag pipelines.

The first public lint run of 1.5.0-beta.2 failed NewApi at
NovaGameDetailActivity.kt:597: getSystemService(Class) needs API 23 while
Nova supports API 21. Registration already returns below Android 7.0 and
is the only place the callback field is set, so the cleanup never reached
that call on older devices, but lint cannot see that invariant.

The cleanup now takes and clears the callback as before, then makes the
same Android 7.0 check explicit before asking for ConnectivityManager. The
callback stays nullable and owned by the activity, and API 21 support,
lint settings and the baseline are unchanged.

The activity is Android only and is not a Steam Frame build input, so the
Frame release guard's RELEASE_ONLY set gains exactly its path. The pinned
Frame source, tree, bundle and runtime stay as qualified. The existing
readback contract test adds three cases: an activity-only change passes,
and a near-name file or another Android source is refused before any
release call.

Checked: the test's embedded Frame controls pass all 30 cases on this
tree and refuse the activity-only case against the previous workflow.
Android lint and JUnit were not run locally.
@papi-ux
papi-ux merged commit 326b2c0 into master Oct 20, 2026
9 checks passed
@papi-ux
papi-ux deleted the review/nova-api21-cleanup-20261020 branch October 21, 2026 11:26
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