Skip to content

fix: store shared screen frames in emulator-approved temp directory - #25

Open
Dirt2939 wants to merge 1 commit into
Wolklaw:mainfrom
Dirt2939:fix/shared-frame-temp-directory
Open

Dirt2939 wants to merge 1 commit into
Wolklaw:mainfrom
Dirt2939:fix/shared-frame-temp-directory

Conversation

@Dirt2939

Copy link
Copy Markdown

Android Emulator 37.3.10 rejects file-backed shared memory outside its permitted temporary directories. AndroidBox currently creates .frame files in its data directory, leaving the main screen blank even though Android boots successfully and instance thumbnails work.

The emulator log reports Rejected shared memory handle for those files.

This change stores shared frames under tempfile.gettempdir()/AndroidEmulator, prefixes their names with androidbox-, and creates the directory before opening the memory-mapped file. The existing fallback to regular image transport is retained if file creation fails.

Validation:

  • Reproduced the blank main screen on Windows 11 with AndroidBox 1.12.1, Android 16, and Android Emulator 37.3.10.
  • Confirmed the Android home screen appears after applying the fix and running AndroidBox from source.
  • Ran the 1.12.1 test suite with the fix: 101 tests run, 99 passed and 2 skipped.

Other operating systems have not been manually tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant