feat: local, offline Wi-Fi API for the pinned kiosk app
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- api, authorization, mobile
Hướng nghiên cứu
Read ADR-0009 and the agent's kiosk configuration handling around pinPackage and config.apply before anything else. The open questions (naming, authority, the optional consent toggle, and the installer-of-record guard) need a maintainer decision before any code is written. Done means a maintainer has settled those points and a reviewed PR adds the ${applicationId}.localapi provider with its authorization checks.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Area
Device agent (Android)
The problem
We run a single-app kiosk on fully managed tablets: the MDMesh agent is Device Owner, and our app is pinned (kioskMode single). The tablets sit in people's homes, and the kiosk app has its own Wi-Fi screen. When a household changes its router or Wi-Fi password, the person at the tablet has to join the new network from inside the kiosk.
Since Android 10, only the Device Owner (or the system) can add, enable, disable or remove saved networks, or switch the radio. addNetwork, enableNetwork, disableNetwork, removeNetwork and setWifiEnabled all fail for any other app targeting Q or later. No delegation scope covers Wi-Fi. So under MDMesh the pinned app can't manage Wi-Fi at all.
It also has to work offline. The moment Wi-Fi needs changing is usually the moment the device has no connectivity, so a policy or command from the server can't help. Today the wifi and wifiRadio policies lock the Wi-Fi settings and switch the radio, and the enrollment QR code's Wi-Fi fields only cover first contact. Nothing in the agent adds a network after enrollment.
Proposed solution
A small local API in the agent that works offline, usable only by the app the kiosk is pinned to:
-
Transport: an exported
ContentProviderat${applicationId}.localapi, implementingcall()only. -
Methods:
describewifi.connect {ssid, password, security: open|wep|psk|sae}wifi.savedwifi.forget {ssid}wifi.setAutoJoin {ssid, enabled}wifi.disconnectwifi.setRadio {enabled}
Every reply carries
ok,code,messageandapiVersion. -
Authorization, checked in the agent on every call, offline:
- the agent is Device Owner;
- the persisted kiosk is single-app, and its
pinPackageequalsgetCallingPackage(), which the platform verifies; - the caller's installer of record is the agent.
Anything else gets
UNAUTHORIZEDwith a reason.describealways answers, so the app can tell whether it may use the API. -
Logging: no passwords or SSIDs in logs. The five calls that change something go to the event log as
localApi <method> <code>. -
No protocol change: it's local to the device, so
/agent/v1is untouched (ADR-0009).
If you'd rather have explicit consent than the implicit "pinned app" rule, I'm happy to gate it behind a configuration toggle, say "Let the kiosk app manage Wi-Fi", off by default. That would add one field to config.apply.
We have this implemented on an agent-only branch with unit tests, and ./gradlew detekt assembleDebug lintDebug testDebugUnitTest passes: https://github.com/MDMesh-app/MDMesh/compare/main...nexi-space:MDMesh:feat/local-wifi-bridge. We're testing it on a Lenovo Tab running Android 16 now. We'd much rather stay on main than carry a fork, so if the direction fits, I'll open a PR, split however you prefer.
Open questions for you:
- the naming and the authority;
- whether you want the toggle;
- whether the installer-of-record check is the right extra guard. It also rejects an app that has updated itself through its own
PackageInstallersession, until MDMesh reinstalls it.
Alternatives considered
WifiNetworkSpecifier: the connection is bound to the requesting app's process and lost when it restarts. It isn't a saved network.- Network suggestions: best-effort, need user approval, and can't be removed or listed reliably.
ACTION_WIFI_ADD_NETWORKS: a system "Save network?" dialog, Settings must be allowed in lock task, and the app can't forget a network.- A helper app targeting API 28, for the legacy
addNetworkpath: it relies on a compatibility exception Google could remove. - Pushing Wi-Fi from the server: doesn't help a device that's offline.
- Being our own DPC: what we're moving away from by adopting MDMesh.
Before submitting
- I searched existing issues and discussions for the same idea.
- Ngôn ngữ chính
- Java
- Star
- 44
- Fork
- 25
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 80
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MDMesh-app/MDMesh
-
enhancement
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
MDMesh-app/MDMesh#252 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Change Kiosk TitleĐang mởenhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
MDMesh-app/MDMesh#253 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
MDMesh-app/MDMesh#232 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 45/100
MDMesh-app/MDMesh#205 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
MDMesh-app/MDMesh#204 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của MDMesh-app/MDMesh
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug devops low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
aphtech/brailleblaster#209 ·
Maintainer thường phản hồi trong vòng 1 ngày