Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Platform findings

Behaviour of Android, OEM skins, PipeWire, adb and GStreamer that was found by testing on real hardware and that the code depends on. Check this page before you change the code named in an entry, and add an entry when you find new behaviour.

Each entry gives the finding, where it was seen and what the code does. “Seen on” is the only configuration on which the finding was checked. Unless an entry says otherwise, the set-up was:

PartVersion
PhoneGalaxy A55, One UI 8.5 (Android 16). Android 17 for the webcam entries
DesktopLinux Mint 22 (Ubuntu 24.04 base), Cinnamon on X11
AudioPipeWire 1.0.5, WirePlumber 0.4.17
adb35.0.0
Video decodernvh264dec (no VA-API decoder on the test machine)

TLS and pairing

AndroidKeyStore TLS keys need DIGEST_NONE

  • Finding: Conscrypt signs the TLS 1.3 CertificateVerify message with a digest it has already computed. A key in AndroidKeyStore that does not allow DIGEST_NONE fails the handshake.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.1.0.
  • Code: the identity key is created with DIGEST_NONE and DIGEST_SHA256. A key that is known to lack it is regenerated. A transient KeyStore error does not trigger regeneration. android/app/src/main/java/org/tether/android/core/identity/Identity.kt.

The phone’s TLS listener runs whenever the app is visible

  • Finding: before pairing nothing is trusted, so the foreground service is not running. A desktop that dials the phone to pair finds no listener unless the app starts one.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.1.0.
  • Code: the service, and with it the listener on port 7360, starts when the app comes to the foreground. UDP beacons are sent only while the app is visible. android/app/src/main/java/org/tether/android/TetherApp.kt.

Stale trust must not cause a reconnect loop

  • Finding: unpairing while the peer was offline left the peer believing it was still paired. It reconnected every second and both user interfaces flickered.
  • Seen on: Galaxy A55 with the desktop daemon, release 0.1.0.
  • Code: restricted frames on an unpaired session are ignored and answered with one Unpair. A pending Unpair is delivered on the next contact. Unpair is allowed on unpaired sessions. The phone backs off when a session dies right after Hello. Test: desktop/crates/tether-core/tests/disconnect_hold.rs. See wire protocol, “Stale trust”, and ADR-0012.

The QR code carries only real LAN addresses

  • Finding: a desktop with container or virtual machine bridges (docker0, br-*, veth*, virbr*, lxc*) put addresses into the pairing URI that the phone cannot reach.
  • Seen on: the Linux desktop, release 0.1.0.
  • Code: those interfaces are filtered out when the desktop lists its addresses. desktop/crates/tether-core/src/discovery/mod.rs.

Desktop app pages re-bind when the daemon restarts

  • Finding: when the daemon restarted while the app was open, the app rebuilt its device objects but its pages stayed bound to the old ones, with no Disconnect or Unpair buttons and no pairing code.
  • Seen on: the Linux desktop, release 0.1.0.
  • Code: a page re-binds when the device object instance changes (desktop/crates/tether-gtk/).

Android background and permissions

No self-managed companion association for sideloaded apps on One UI

  • Finding: REQUEST_COMPANION_SELF_MANAGED is signature|privileged on One UI 8.5. A sideloaded app cannot create a self-managed CompanionDeviceManager association.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16).
  • Code: the companion step is optional. The app checks whether it holds the permission before it offers the step, and works without the association. android/app/src/main/java/org/tether/android/ui/onboarding/CdmScreen.kt. See ADR-0005 and ADR-0007.

One UI logs clipboard denials with different wording

  • Finding: background clipboard sync watches the log for the line the clipboard service writes when it refuses access. AOSP writes Denied clipboard access to <pkg>. Android 14 and later and One UI write Denying clipboard access to <pkg>,.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.2.0.
  • Code: it matches clipboard access to <pkg>, which is common to both. android/app/src/main/java/org/tether/android/features/misc/ClipboardFeature.kt. See ADR-0013, amendment.

Messages and photos

SMS and MMS changes are not notified on content://mms-sms/

  • Finding: the platform does not notify observers of content://mms-sms/ when an SMS changes, so live updates never fired.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.2.0.
  • Code: the phone registers its observer on content://sms and content://mms as well. android/app/src/main/java/org/tether/android/features/messages/MessagesFeature.kt.

The media provider may refuse to delete a photo

  • Finding: some OEM media providers refuse a delete from another app even when the app has all-files access.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.2.0.
  • Code: it falls back to deleting the file and asking the media scanner to rescan the path. android/app/src/main/java/org/tether/android/features/photos/PhotosRepository.kt.

Calls and audio

PipeWire exposes a phone’s call audio as streams, only while SCO is open

  • Finding: when the remote device is a phone (the PC is the hands-free unit), PipeWire creates the HFP nodes with media.class Stream/Output/Audio (the caller’s voice) and Stream/Input/Audio (the microphone path). They are not Audio/Source and Audio/Sink. They exist only while the phone holds the SCO link open, and WirePlumber links them to the default devices by itself. Selecting a card profile does not create them. The PC can close SCO by switching the card profile to off. It cannot open it.
  • Seen on: PipeWire 1.0.5, WirePlumber 0.4.17, mSBC, Galaxy A55, One UI 8.5 (Android 16), release 0.3.0.
  • Code: the presence of the HFP nodes means that call audio is on the PC. The daemon polls the graph once a second during a call. To move audio to the PC it asks the phone (ROUTE). To move it away when the phone refuses, it switches the card profile off and restores it shortly afterwards. Test fixtures use the classes and port names of a real graph. desktop/crates/tetherd/src/pipewire.rs, src/features/audio.rs. See call audio spike, finding 1, and ADR-0015, amendment.

Telecom binds the in-call service only with the app-op MANAGE_ONGOING_CALLS

  • Finding: without a bound InCallService an app cannot route call audio. Holding CALL_COMPANION_APP does not bind the service, and telecom add-or-remove-call-companion-app exits with 0 and has no effect. The app-op MANAGE_ONGOING_CALLS, allowed over adb, binds it. The permission must also be declared in the manifest.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.3.0.
  • Code: the manifest declares the permission, and the grant is one of the adb grants of the enhanced set-up. Without it, ROUTE commands answer route_unsupported and the desktop falls back to closing SCO. android/app/src/main/java/org/tether/android/features/calls/TetherInCallService.kt, android/app/src/main/AndroidManifest.xml. See call audio spike, finding 2.

Echo cancellation runs in monitor mode

  • Finding: on laptop speakers the caller’s voice returns through the microphone and the phone suppresses the uplink, so the caller loses words. Routing both call directions through a virtual sink and source removed the echo but caused drop-outs. Monitor mode (monitor.mode = true: the canceller reads the real sink’s monitor, only the microphone side moves) was clear in both directions. Monitor mode cannot be set through pipewire-pulse’s module-echo-cancel, and a module loaded with pw-cli dies with pw-cli.
  • Seen on: PipeWire 1.0.5, WirePlumber 0.4.17, release 0.3.0.
  • Code: the daemon writes a configuration file to $XDG_RUNTIME_DIR/tether-echo-cancel.conf and runs pipewire -c <conf> as a child for the duration of the calls, only when the call uses the default sink and source. It points the phone’s microphone node at the cancelled source with pw-metadata, and does not add links to the raw microphone while the canceller owns the routing. Configuration key call_echo_cancel. desktop/crates/tetherd/src/features/audio.rs. See call audio spike, finding 3.

pw-dump can print two JSON arrays

  • Finding: pw-dump prints a second array when the graph changes while it runs.
  • Seen on: PipeWire 1.0.5.
  • Code: it parses the first JSON value only. desktop/crates/tetherd/src/pipewire.rs.

A small quantum makes call audio worse

  • Finding: forcing a small quantum (clock.force-quantum 256) to cure out of buffers messages on the microphone path increased them. Kernel messages about corrupted SCO packets did not coincide with bad audio.
  • Seen on: PipeWire 1.0.5, mSBC.
  • Code: it leaves the quantum and the codec alone. See call audio spike, finding 4.

adb and the enhanced tier

The decisions behind these entries are in ADR-0016 and ADR-0017.

Wireless debugging changes its port on every toggle

  • Finding: Wireless debugging keeps its mDNS instance name and changes its port each time it is switched on. An mDNS browse that is already running does not report the new port.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.4.0.
  • Code: it resolves the instance again before every adb connect. desktop/crates/tetherd/src/features/enhance.rs.

One UI switches Wireless debugging back off on a network that was not allowed

  • Finding: when the user has not allowed the current Wi-Fi network for Wireless debugging, One UI sets adb_wifi_enabled straight back to off after an app switches it on.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.4.0.
  • Code: the automatic re-arm is tried once per session, never in a loop. desktop/crates/tetherd/src/features/enhance.rs.

adb pair and adb connect exit with 0 on failure

  • Finding: adb connect, and adb pair before 34.0.5, report failure only in their output.
  • Seen on: adb 35.0.0.
  • Code: one command runner parses the output and ignores exit codes. Its tests use captured output. desktop/crates/tetherd/src/adb.rs.

adb’s own mDNS does not work in distribution builds

  • Finding: the mDNS discovery built into adb is unusable in the adb packages of the distributions.
  • Seen on: adb 35.0.0 from the distribution.
  • Code: the daemon starts adb with ADB_MDNS=0 and browses _adb-tls-pairing._tcp and _adb-tls-connect._tcp through Avahi. desktop/crates/tetherd/src/adb.rs, desktop/crates/tether-core/src/discovery/avahi.rs.

The helper’s token goes over stdin, never in the arguments

  • Finding: process arguments on the phone are visible to other processes through ps.
  • Code: the daemon writes the one-time token as the first line of the helper’s stdin. desktop/crates/tetherd/src/shell.rs, android/app/src/main/java/org/tether/shell/Main.kt.

uiautomator dump --display-id ignores the display on One UI

  • Finding: the command dumps the main screen whatever display is named.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16).
  • Code: the option was removed from android/tools/helper_test.py. See the rules for device tests in Test your changes.

All helper abilities work on Android 16 without a fallback

  • Finding: all ten abilities of the shell helper were available. Typing into virtual displays was reliable (15 of 15 keys, 15 of 15 text entries). The typing problem reported for Android 16 as scrcpy issue 6909 did not reproduce.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16), release 0.4.0.
  • Code: abilities are probed at every helper start and reported in ShellHello. The desktop offers only what was probed. The paste fallback for text input is kept.

USB debugging authorisation can flip to “unauthorized”

  • Finding: after replugging the cable or toggling debugging, the phone reported unauthorized until the prompt was accepted again with Always allow from this computer.
  • Seen on: Galaxy A55, One UI 8.5 (Android 16).
  • Code: the daemon tracks the adb device state, including unauthorized. desktop/crates/tetherd/src/adb.rs.

A Wireless debugging pairing can stop working after a system update

  • Finding: a pairing made under Android 16 no longer connected after the phone was updated to Android 17. The update is the probable cause. Pairing again fixed it.
  • Seen on: Galaxy A55, Android 16 to Android 17.
  • Code: nothing automatic. The set-up wizard pairs again.

Mirroring and webcam

The decisions behind the webcam entries are in ADR-0019.

The first decoder start with nvh264dec is slow

  • Finding: the first start of a GStreamer pipeline with nvh264dec takes 2 to 9 s under load. Later starts are fast.
  • Seen on: NVIDIA GPU, GStreamer from Ubuntu 24.04, release 0.4.0.
  • Code: the mirror window shows the picture when the first frame arrives. Neither code nor tests treat a slow first start as a failure. desktop/crates/tether-gtk/src/mirror/. See ADR-0018.

Call apps list V4L2 devices only

  • Finding: video call apps and the default browser builds list V4L2 devices. They do not show PipeWire camera nodes unless the user changes browser settings.
  • Seen on: Linux Mint 22, Ubuntu 24.04.
  • Code: the webcam is a v4l2loopback device fed by the daemon.

v4l2loopback 0.12.7 has no control device and no client-usage event

  • Finding: the version in Ubuntu 24.04 and Linux Mint 22 has no v4l2loopback-ctl add (0.13 and later only), so a module that is already loaded without the project’s device cannot be extended. It also cannot tell the daemon that an app opened the device.
  • Seen on: v4l2loopback 0.12.7.
  • Code: the set-up script stops with an instruction to unload the module in that case. The webcam is a switch that the user turns on. It is not started on demand. desktop/packaging/webcam/tether-webcam-setup, desktop/crates/tetherd/src/webcam_setup.rs.

v4l2sink rejects caps without the device’s colorimetry

  • Finding: v4l2sink does not accept output caps that lack the colorimetry the loopback device reports.
  • Seen on: GStreamer from Ubuntu 24.04, v4l2loopback 0.12.7.
  • Code: the daemon queries the sink pad once and takes the output caps from it. desktop/crates/tetherd/src/webcam.rs.

With exclusive_caps=1 the device is listed only while it is fed

  • Finding: apps list the virtual camera only while a producer writes to it, and a consumer must never see the format change.
  • Code: an output stage holds the device open for as long as the switch is on and is fed black frames whenever no capture runs. Each capture gets its own decode stage. The device format is fixed. Rotation, flip and a camera switch change the picture inside that frame. desktop/crates/tetherd/src/webcam.rs.

pkexec cannot gain privileges from the packaged service

  • Finding: the systemd user unit sets NoNewPrivileges=yes, so a setuid pkexec started by the daemon cannot become root.
  • Code: when the daemon runs with that flag it starts pkexec through systemd-run --user. This path has not been verified from the installed package. desktop/crates/tetherd/src/webcam_setup.rs, desktop/packaging/systemd/tetherd.service.

The shell user can open the camera, with one Android 16 change

  • Finding: the shell user holds android.permission.CAMERA and can open Camera2 without a visible activity or a foreground service. On Android 16 reading the camera characteristics goes through ActivityManager, which needs a patched context.
  • Seen on: Galaxy A55, Android 17. Start to first key frame 0.84 to 1.47 s.
  • Code: the helper creates CameraManager through its hidden constructor on the fake context and patches the ActivityManager context. android/app/src/main/java/org/tether/shell/CameraCapture.kt, FakeContext.kt. See Milestone 4 research: shell helper, section 8.

Another camera client takes the camera away

  • Finding: when another app on the phone opens the camera, the helper’s capture is disconnected.
  • Seen on: Galaxy A55, Android 17.
  • Code: the helper reports CameraEnded with the reason camera_disconnected. The device on the desktop stays open and shows black frames. See wire protocol, “Phone as webcam”.

Not yet tested

Treat code that depends on these as unverified. The current list is in the roadmap.

AreaOpen question
Webcamthe camera while the phone is locked or the screen is off, the camera privacy switch (camera_disabled), the persist and remove actions of the set-up script
Enhanced tierre-arm of Wireless debugging after a phone reboot, Samsung Auto Blocker, physical rotation of a whole-screen mirror, measured mirror latency
DesktopWayland sessions (window class of pinned apps, dmabuf path), VA-API decoders
Callsthe MANAGE_ONGOING_CALLS grant after a phone reboot, adapters and phones other than the one tested