Generated web app icons are retried after sync and network reconnect

#40185008 Android APK verification builds Status: New

What this is

Sampler

Issue 40185008 tracks synced web apps that keep generated placeholder icons after Chrome failed to fetch the real icon during install. Dan's latest request was to implement the stop-gaps in the code: retry after sync install/update, and retry again when the network reconnects.

The patched APKs below include those stop-gaps. The sampler page provides an installable PWA with real manifest icons for manual verification of icon availability and install behavior.

Deterministic emulator verification

The launcher icon is not a reliable oracle: it can be cached, updated late by WebAPK/launcher plumbing, or differ between devices. For the patched debug APK, use run-as org.chromium.chrome and verify Chrome's stored web app state directly.

This test mutates an installed test PWA so Chrome thinks it has a generated icon, then triggers the network-reconnect repair path. A passing patched build flips is_icon_generated back to false.

# 1. Install the patched debug APK and open the sampler.
adb install -r ChromePublic-generated-icon-fix-x86.apk
adb shell am start -a android.intent.action.VIEW \
  -d 'https://static.januschka.com/i-40185008/demo.html' \
  -p org.chromium.chrome

# 2. Manually add the sampler to the home screen, then launch it once.
# The page should show: display-mode standalone: YES.

# 3. Find the webapp preference file for this sampler.
PREF=$(adb shell run-as org.chromium.chrome sh -c \
  "grep -l 'https://static.januschka.com/i-40185008/' shared_prefs/webapp_*.xml" \
  | tr -d '\r' | head -1)
echo "$PREF"

# 4. Confirm the installed app currently has a real icon.
adb shell run-as org.chromium.chrome grep is_icon_generated "$PREF"
# Expected before mutation:
#   <boolean name="is_icon_generated" value="false" />

# 5. Mutate the stored state to simulate the original bug condition.
adb shell am force-stop org.chromium.chrome
adb exec-out run-as org.chromium.chrome cat "$PREF" > /tmp/webapp_pref.xml
python3 - <<'PY'
s = open('/tmp/webapp_pref.xml').read()
s = s.replace('name="is_icon_generated" value="false"',
              'name="is_icon_generated" value="true"')
open('/tmp/webapp_pref_mut.xml', 'w').write(s)
PY
adb push /tmp/webapp_pref_mut.xml /data/local/tmp/webapp_pref_mut.xml
adb shell run-as org.chromium.chrome cp /data/local/tmp/webapp_pref_mut.xml "$PREF"
adb shell run-as org.chromium.chrome grep is_icon_generated "$PREF"
# Expected after mutation:
#   <boolean name="is_icon_generated" value="true" />

# 6. Trigger the network-reconnect repair path.
adb shell am start -a android.intent.action.VIEW \
  -d 'https://static.januschka.com/i-40185008/demo.html' \
  -p org.chromium.chrome
adb shell svc wifi disable
adb shell svc data disable
sleep 3
adb shell svc wifi enable
adb shell svc data enable
sleep 30

# 7. Verify the patched build repaired the generated-icon state.
adb shell run-as org.chromium.chrome grep is_icon_generated "$PREF"
# Expected patched result:
#   <boolean name="is_icon_generated" value="false" />

Notes: this requires a debuggable APK where run-as org.chromium.chrome works. If run-as fails, use the debug verification APK or add temporary logcat statements around the generated-icon retry scheduler/runner.

Android does not provide a reliable generic ADB command that forces Chrome Sync datatypes to download immediately. The most reliable manual nudge is chrome://sync-internals after sign-in, plus restarting Chromium and toggling network connectivity. The patch under test specifically handles the latter by scheduling generated icon fixes when the device reconnects.

Downloads

Download APK: arm64 device Download APK: x86 emulator SHA256 checksums Open sampler PWA