Commit e336a75
fix(appium): skip data connectivity on devices without telephony (#5677)
`mobile: setConnectivity` runs `adb shell svc <type> <state>` for every
field it is passed, so always sending `data` made setNetworkConnection()
fail with "Can't find service: phone" (adb exit 20) on system images
without telephony, such as tablet emulators. This regressed in 4.1.0,
when #5662 replaced the legacy setNetworkConnection command, which
tolerated the missing phone service.
Probe `mobile: deviceInfo` for a carrier and only send `data` when the
device actually has telephony. Dropping `data` unconditionally is not an
option: on a telephony-capable device it leaves cellular up, so going
offline silently does nothing and tests keep passing against a device
that is still online.
Only a positive probe result is cached. A freshly booted device may not
have registered a carrier yet, and since the first call typically comes
from a suite-setup hook seconds after boot, caching that negative would
strip `data` for the rest of the session on a real phone. Guarding with
`!this._hasTelephony` re-asks until a carrier appears, then stops.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 8b91815 commit e336a75
2 files changed
Lines changed: 39 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
981 | | - | |
| 981 | + | |
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
985 | | - | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
986 | 998 | | |
987 | 999 | | |
988 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
47 | 71 | | |
48 | 72 | | |
49 | 73 | | |
| |||
0 commit comments