Skip to content

Commit

Permalink
Basic support for OPEN_DOCUMENT intent
Browse files Browse the repository at this point in the history
Allows external programs use Amaze to open files with OPEN_DOCUMENT intent.

Addresses TeamAmaze#3932
  • Loading branch information
TranceLove committed Sep 11, 2023
1 parent 9f5ba39 commit 957839b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.OPENABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

<intent-filter tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="application/zip" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@ private void checkForExternalIntent(Intent intent) {
mRingtonePickerIntent = true;
Toast.makeText(this, getString(R.string.pick_a_file), Toast.LENGTH_LONG).show();

// disable screen rotation just for convenience purpose
// TODO: Support screen rotation when picking file
Utils.disableScreenRotation(this);
} else if (actionIntent.equals(Intent.ACTION_OPEN_DOCUMENT)) {
mReturnIntent = true;
Toast.makeText(this, getString(R.string.pick_a_file), Toast.LENGTH_LONG).show();

// disable screen rotation just for convenience purpose
// TODO: Support screen rotation when picking file
Utils.disableScreenRotation(this);
Expand Down

0 comments on commit 957839b

Please sign in to comment.