diff mbox series

[meta-oe] android-tools: drop android-gadget-setup call from android-tools-adbd.service

Message ID 20261118145203.2577227-1-ecordonnier@snap.com
State Under Review
Headers show
Series [meta-oe] android-tools: drop android-gadget-setup call from android-tools-adbd.service | expand

Commit Message

Etienne Cordonnier Nov. 18, 2026, 2:52 p.m. UTC
From: Etienne Cordonnier <ecordonnier@snap.com>

The unit calls "/usr/bin/android-gadget-setup adb" from ExecStartPre,
prefixed with "-" so that a failure is ignored. The android-gadget-setup in
this layer does not read its arguments, so "adb" has no effect. That adb parameter
is historical: it is used in meta-smartphone which is where the meta-oe
android-tools recipe was imported from.

The call made sense while there were two android-tools-conf
implementations. The sysfs-based one installed only android-gadget-setup,
so the unit was what ran it. The configfs-based one ships its own drop-in,
10-adbd-configfs.conf, which runs android-gadget-setup, android-gadget-start
and android-gadget-cleanup. Commit 55cc6751e426 ("android-tools-conf:
replace sysfs implementation with configfs") removed the sysfs
implementation. Since then android-gadget-setup runs twice on every start,
and the second run first tears down the gadget created by the first one.
The unit also refers to a file that is not installed when android-tools-conf
is not.

Remove the call from the unit and leave the gadget setup to the drop-in.
Layers that replace android-gadget-setup and remove the drop-in, such as
meta-android in meta-smartphone, whose script takes the USB function list as
argument, need to run it from their own drop-in ( see https://github.com/shr-distribution/meta-smartphone/pull/204 ).

AI-Generated: Uses Claude Code
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 .../android-tools/android-tools/android-tools-adbd.service       | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service b/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service
index 7c16b5cea2..f8c8bc7f33 100644
--- a/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service
+++ b/meta-oe/recipes-devtools/android-tools/android-tools/android-tools-adbd.service
@@ -6,7 +6,6 @@  Before=android-system.service
 [Service]
 Type=notify
 Restart=on-failure
-ExecStartPre=-/usr/bin/android-gadget-setup adb
 ExecStart=/usr/bin/adbd
 
 [Install]