Skip to content

[ai] android tv: Support ACTION_OPEN_DOCUMENT file picking - #4707

Open
muhamadsyafii wants to merge 1 commit into
TeamAmaze:release/4.0from
muhamadsyafii:syafii/bugfix/4079-android-tv-file-picker
Open

[ai] android tv: Support ACTION_OPEN_DOCUMENT file picking#4707
muhamadsyafii wants to merge 1 commit into
TeamAmaze:release/4.0from
muhamadsyafii:syafii/bugfix/4079-android-tv-file-picker

Conversation

@muhamadsyafii

Copy link
Copy Markdown

Fixes: #4079

Description

Some Android TV applications use ACTION_OPEN_DOCUMENT to find a
file manager, while Amaze only advertised ACTION_GET_CONTENT.

Advertise the missing intent and route it through the existing
file-picking flow so selected files are returned to the caller.
The existing GET_CONTENT behavior remains unchanged.

Add regression coverage for manifest resolution and file-picker mode
activation.

Amaze was verified as an available file manager alongside Material
Files. Selecting ALWAYS made subsequent OPEN_DOCUMENT requests
launch Amaze directly without displaying ResolverActivity.

Issue tracker

Fixes #4079

Automatic tests

  • Added unit tests for specific individual functions
  • Added headless tests for new app functionality
  • Added emulator tests for new UI elements

Successfully ran:

  • ./gradlew :app:testFdroidDebugUnitTest --tests com.amaze.filemanager.ui.activities.MainActivityTest --tests com.amaze.filemanager.ui.fragments.MainFragmentReturnIntentResultsTest

Manual tests

  • Done

  • Devices:

    • Polytron PLD 43S883MBN
    • Amlogic Media Player Android Box
  • OS:

    • Android TV 7.1.2 (API 25)
    • Android 9 (API 28)

Manually verified:

  • Amaze appears alongside Material Files in the system resolver
  • ACTION_OPEN_DOCUMENT with */*
  • ACTION_OPEN_DOCUMENT with specific MIME types
  • Existing ACTION_GET_CONTENT flow
  • Single-file selection
  • Multiple-file selection
  • Warm MainActivity intent handling
  • D-pad navigation
  • Cancellation using the Back button
  • Selecting ALWAYS launches Amaze directly on later requests
  • No crashes, ANRs, SecurityException, or unintended file viewers

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew assembleFdroidDebug
  • ./gradlew spotlessCheck

Generative code

  • This PR used generative code tools (GenAI, LLMs, etc.)

  • Model: Codex

  • Version: GPT-5

  • Provider: OpenAI

Additional technical write-up

A more detailed explanation of the root cause, implementation decisions,
and physical Android TV testing is available here:

Making Amaze Discoverable as a File Manager on Android TV

Screenshots

Amaze is now discovered alongside Material Files as an
ACTION_OPEN_DOCUMENT handler on an Android Box running Android 9
(API 28).

Amaze Debug and Material Files shown in the Android TV resolver

After selecting Amaze, Android provides the JUST ONCE and ALWAYS
options, allowing Amaze to become the default handler for matching
file-picker requests.

Android TV resolver showing Just Once and Always options for Amaze

Some Android TV applications use ACTION_OPEN_DOCUMENT to find a
file manager, while Amaze only advertised ACTION_GET_CONTENT.

Advertise the missing intent and route it through the existing
file-picking flow so selected files are returned to the caller.
Add regression coverage for manifest resolution and picker mode.

Verified on Android TV API 25 and Android Box API 28.

Fixes TeamAmaze#4079.
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.

Cant set Amaze as the default file manager on Android TV

1 participant