Skip to content

refactor(connectivity): move ConnectivityStateHolder out of presentation/ - #2820

Closed
PonceGL wants to merge 1 commit into
PixelPlayerHQ:masterfrom
PonceGL:chore/p5-connectivity-state-holder-location
Closed

PonceGL wants to merge 1 commit into
PixelPlayerHQ:masterfrom
PonceGL:chore/p5-connectivity-state-holder-location

Conversation

@PonceGL

@PonceGL PonceGL commented Sep 10, 2026

Copy link
Copy Markdown

What

ConnectivityStateHolder lives in presentation/viewmodel/, but
data/service/player/DualPlayerEngine.kt (data layer) already imports it from
there — a data → presentation dependency inversion that predates this change.
One of the small independent fixes listed in #2813.

Change

Moves the file to data/connectivity/, a new single-file package (same shape
as the existing data/paging/ and data/provider/). Package/import only —
zero behavior change.

Moves, not splits. The file also mixes Wi-Fi/network state with Bluetooth
state (591 lines, more than one reason to change), but separating those is a
refactor with its own design questions and doesn't belong in a preparatory
move. Noted as a possible follow-up, not done here.

9 files touched: the file itself, DualPlayerEngine.kt, and 7 more that
reference ConnectivityStateHolder/BluetoothAudioDeviceState — 3 of them
were in the same package and resolved it with no import at all, so they
gained one; the rest just had their import path updated.

Known, accepted side effect

app/src/release/generated/baselineProfiles/*.txt still reference the old
presentation.viewmodel.ConnectivityStateHolder path. Those are ART profile
hints, not code — they simply stop matching for this class until the profile
is regenerated on-device, which needs a benchmark run and is out of scope for
this PR.

Testing

No new tests: no logic changed, nothing new to assert. :app:testDebugUnitTest
— 388 tests, same 5 pre-existing failures as master's baseline, none new.
:app:assembleDebug succeeds.

…ion/

DualPlayerEngine (data/service/player/) already imports it from
presentation/viewmodel/ — GEN-ARCH-01 inverted, preexisting, not
introduced by the downloads feature (R20). Moves to data/connectivity/,
a new single-file package matching existing ones (data/paging/,
data/provider/).

Moves, does not split: the file also mixes Bluetooth state (591 lines,
more than one reason to change per GEN-DES-01), but splitting it is a
refactor with its own judgment calls and doesn't belong in this
preparatory fix (F3.md §4.1).

Zero behavior change: package/import only. 9 files touched (3 resolved
it via same-package before and needed a new import; the rest just had
their import path updated). Baseline: 388 tests, same 5 pre-existing
failures, none new (check-baseline.sh). assembleDebug verified.

Known, accepted side effect: app/src/release/generated/baselineProfiles/
still reference the old presentation.viewmodel.ConnectivityStateHolder
path — those are ART hints, not code; they just stop matching for this
class until the profile is regenerated on-device, which is out of scope
here.
@PonceGL

PonceGL commented Sep 10, 2026

Copy link
Copy Markdown
Author

Closing for now — reorganizing how this work is staged. It'll go through our fork first and we'll propose it upstream again, possibly bundled differently, once the larger feature it's part of is further along. Not a rejection, just a process change on our side.

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