From 25152ddb61a89ea3ea29d3aef5de13343429d32a Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Fri, 9 Oct 2026 18:23:52 +0200 Subject: feat: back up the phone's photos to a group, once a day on Wi-Fi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Android application sends the photos taken on the phone to one folder of one group chosen by the member (docs/MESHBAY_DESIGN.md §9.12). The phone lists MediaStore, keeps a ledger of what was sent and hands each photo's bytes to the page by an opaque token on the packaged origin; the page decides when a run is due and uploads through the existing path, one photo at a time under a slot. - Once a day from the last finished run, on an unmetered network only; "Back up now" asks first on mobile data. Leaving Wi-Fi stops after the file in flight. - Photos already on the phone are sent by default, newest first, under /YYYY/MM; edits are sent beside the original as -edited-. - Additive by construction: nothing is ever deleted, renamed or replaced on the node, and a photo deleted on the node is not sent again. - A confirmation names the group, owner, members, folder and size when the destination or starting point changes; a lasting refusal (disk full, folder read-only or gone, no longer a member) is said once and retried a day later. - No ACCESS_MEDIA_LOCATION, so the platform redacts photo locations. - A dataSync foreground service keeps a run going with the screen off. HEIC/HEIF photos are sent but not shown in Photos yet (§15.2). Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_cast.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-hub/tests/test_android_cast.py') diff --git a/packages/meshbay-hub/tests/test_android_cast.py b/packages/meshbay-hub/tests/test_android_cast.py index ebcdec4..82b36d6 100644 --- a/packages/meshbay-hub/tests/test_android_cast.py +++ b/packages/meshbay-hub/tests/test_android_cast.py @@ -113,11 +113,12 @@ def test_relay_calls_keep_their_order(): " || frame.channel == BinaryFrame.CAST_FILE") in _read(SRC / "bridge" / "Channels.kt") -def test_screen_off_survival_is_switched_on_only_while_casting_or_playing(): +def test_screen_off_survival_is_switched_on_only_while_casting_playing_or_backing_up(): activity = _read(SRC / "MainActivity.kt") keep = activity.split("private fun keepAlive()", 1)[1].split("\n }\n", 1)[0] assert "val on = casting || playing" in keep - assert "web.keepVisible = on" in keep + # A photo backup holds the page too, through its own service (§9.12). + assert "web.keepVisible = on || syncing" in keep assert "if (!on) { stopService(service); return }" in keep assert "startForegroundService(service)" in keep assert activity.count("keepVisible =") == 1, "the page is kept visible from one place only" @@ -126,6 +127,8 @@ def test_screen_off_survival_is_switched_on_only_while_casting_or_playing(): manifest = _read(MAIN / "AndroidManifest.xml") assert 'android:name=".cast.CastService"' in manifest assert 'android:foregroundServiceType="mediaPlayback"' in manifest + assert 'android:name=".photos.BackupService"' in manifest + assert 'android:foregroundServiceType="dataSync"' in manifest def test_the_receiver_is_given_what_the_desktop_gives_it(): -- cgit v1.2.3