Skip to content

WorldWindow v1.9.7 may remain visually black/stale after Android 10 Samsung SurfaceView resume when using uncached online tile layer offline #158

Description

@GeorgePapageorgakis

Description

Intermittent black/stale rendering with earth.worldwind.WorldWindow (WWK 1.9.7) on Android 10 Samsung devices during app minimize/restore and rapid fragment navigation.

The issue is easiest to reproduce when:

  • the app is freshly installed,
  • the selected map is the default online map,
  • there is no internet connection, but device is connected to wifi (tries fetching tiles),
  • WorldWind has not previously cached any default-map tiles,
  • the user minimizes/restores the app or rapidly navigates away from and back to the map fragment.

Imported/offline GeoPackage maps are much harder to reproduce, which suggests the problem is related to a combination of:

  1. Android SurfaceView / EGL surface lifecycle,
  2. WorldWind WorldWindow.onPause() / WorldWindow.onResume(),
  3. many tile/elevation retrieval jobs failing or being cancelled after resume,
  4. an empty cache for the default online map layer.

The app uses a WorldWindow inside a Fragment and keeps a shared map service instance. The WorldWindow is reattached when the map fragment view is recreated. Fragment view lifecycle leaks and incorrect SurfaceView hiding were investigated and fixed on the app side, but the black/stale WorldWind rendering can still happen when Android reports the WorldWindow view as attached and drawable.

Default map configuration is an online OSM/WebMercator layer:
uriString = "https://tile.openstreetmap.org/{z}/{x}/{y}.png"

Reproduction steps

  1. Fresh install the app.
  2. Ensure no internet connection is available.
  3. Use the default map, which points to: https://tile.openstreetmap.org/{z}/{x}/{y}.png
  4. Open the map screen.
  5. Minimize and restore the app, or rapidly navigate from the map fragment to another fragment and back.
  6. Observe that sometimes the map remains black or visually stale for a few seconds.
  7. In some cases tactical/map objects appear as unrendered white squares before the map recovers.
  8. Imported offline maps are much harder to reproduce.

Expected behavior

After WorldWindow.onResume() and Android SurfaceView.surfaceCreated/surfaceChanged, WorldWindow should render a fresh frame or expose a reliable signal that rendering/tile/resource recovery is still incomplete.
If the online basemap has no cached tiles and network is unavailable, the map may reasonably show no basemap imagery, but WorldWind should not leave the GL view visually stale/black in a way that also affects already-attached renderables or icons.

Actual behavior

After app resume, Android reports the WorldWindow as attached, parented, and sized correctly:
resumeWorldWindow: wasPausedBeforeResume=true, restoreRecordedCamera=false, attached=true, parent=true, size=2916x1350

The app-side health check therefore sees the view as drawable and avoids recreating WorldWindow:
WorldWindow recovery check stopped: decision=NoRecovery, generation=14, currentGeneration=14, wasPaused=true, backgroundDurationMillis=132, isDrawableAfterResume=true, isRecoveryAlreadyRunning=false, checkAttempt=1

However, the visible map can remain black/stale for a few seconds, while WorldWind logs many failed/cancelled image/elevation retrievals.

Additional note
The Android system also logs Samsung/SurfaceFlinger sync-point messages during these transitions:
SurfaceFlinger E No local sync point found, barrierLayer : [com.sec.android.app.launcher/com.sec.android.app.launcher.activities.LauncherActivity...]
This appears to be a vendor surface transition symptom rather than an app exception, but it correlates with SurfaceView.surfaceDestroyed / surfaceCreated around WorldWindow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions