aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-10 17:09:12 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-10 17:09:12 +0200
commitb39e73cbb279ab0274e8cd0b84304a602fe1d5ef (patch)
tree91e86b70289f5c0252372f4f05b83b38f049c64f /packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync
parentff982773308d042e4ec68fae9cad5c5742bc7395 (diff)
downloadmeshbay-main.tar.gz
fix(android): what the first backup on a phone showedHEADmain
Slices are asked for in the address, not a Range header the WebView drops; a settings change runs at once; the notification is updated once a second; the SMS section says how to lift Android's restricted setting; the photo section says whether videos are included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync')
-rw-r--r--packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync/DocChannels.kt14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync/DocChannels.kt b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync/DocChannels.kt
index 2efe558..f4da64f 100644
--- a/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync/DocChannels.kt
+++ b/packages/meshbay-android/app/src/main/kotlin/org/meshbay/client/phonesync/DocChannels.kt
@@ -64,6 +64,7 @@ class DocChannels(
"sent" -> { sent(args.optString(0, ""), args.optString(1, ""), args.optString(2, "")); true }
"completed" -> { completed(); status() }
"failed" -> failed(args.optString(0, ""), args.optString(1, ""))
+ "open-settings" -> { openSettings(); true }
else -> throw Refused("Refused: no such channel")
}
@@ -167,6 +168,19 @@ class DocChannels(
permission = null
}
+ /**
+ * The application's page in the system's settings. Android keeps some
+ * permissions (text messages) behind "restricted settings" for an
+ * application installed outside a store; that page is where the person
+ * lifts it (⋮ > Allow restricted settings), and nowhere in here can.
+ */
+ private fun openSettings() {
+ val intent = android.content.Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
+ android.net.Uri.fromParts("package", activity.packageName, null))
+ .addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK)
+ activity.runOnUiThread { activity.startActivity(intent) }
+ }
+
/** From Activity.onRequestPermissionsResult; true when the request was ours. */
fun deliverPermission(requestCode: Int): Boolean {
if (requestCode != permissionRequest) return false