Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 21 additions & 39 deletions android/KMAPro/kMAPro/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />

<!-- needed for properly formatted email messages -->
<data
android:mimeType="application/vnd.keyman"
android:scheme="content" />
<!-- needed for mangled email messages -->
<data
android:mimeType="application/keyman"
Expand All @@ -109,38 +105,41 @@
android:mimeType="application/octet-stream"
android:scheme="content" />
<data
android:mimeType="application/x-keyman-package"
android:mimeType="application/vnd.keyman.kmp+zip"
android:scheme="content" />
</intent-filter>

<!--
Capture file open requests (pathPattern is honoured) where no
MIME type is provided in the Intent. An Intent with a null
MIME type will never be matched by a filter with a set MIME
type, so we need a second intent-filter if we wish to also
match files with this extension and a non-null MIME type
(even if it is non-null but zero length).
-->
<intent-filter android:priority="50">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />

<data android:scheme="file" />
<data android:scheme="content" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matches both file:/// and content:// URIs. Often times, what we get between apps appears to be the content:// one.

It's an OR, not an AND - allowing us to share the host and pathPattern entries for both protocols.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what this is fixing though -- does this impact the underlying reported issue?


<data android:host="*" />
<data android:pathPattern="/.*\\.kmp" />
<data android:pathPattern=".*\\.kmp" />
<data
android:mimeType="application/vnd.keyman.kmp+zip"
android:scheme="content" />

<!--
Backup MIME intents
-->
<data
android:mimeType="application/octet-stream"
android:scheme="content" />
</intent-filter>

<!--
Capture file open requests (pathPattern is honoured) where a
(possibly blank) MIME type is provided in the Intent. This
filter may only be necessary for supporting ES File Explorer,
which has the probably buggy behaviour of using an Intent
with a MIME type that is set but zero-length. It's
impossible to match such a type except by using a global
wildcard.
-->
Capture file open requests (pathPattern is honoured) where no
MIME type is provided in the Intent. An Intent with a null
MIME type will never be matched by a filter with a set MIME
type, so we need a second intent-filter if we wish to also
match files with this extension and a non-null MIME type
(even if it is non-null but zero length).
-->
<intent-filter android:priority="50">
<action android:name="android.intent.action.VIEW" />

Expand All @@ -149,25 +148,8 @@

<data android:scheme="file" />
<data android:host="*" />
<data android:mimeType="*/*" />
<data android:pathPattern="/.*\\.kmp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- http:// and https:// protocols -->
<data
android:host="*"
android:pathPattern="/.*\\.kmp"
android:scheme="http" />
<data
android:host="*"
android:pathPattern="/.*\\.kmp"
android:scheme="https" />
</intent-filter>

<intent-filter>
<!-- keyman:download// deep linking to https://keyman.com/keyboards/ -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ public static boolean isPermissionOK(Activity activity) {
// API 30-32
permissionsOK = Environment.isExternalStorageManager() ||
checkPermission(activity, Manifest.permission.READ_EXTERNAL_STORAGE);
} else {
// API 33+
// We had to remove these MEDIA permissions from AndroidManifest.xml so these will end up failing
// https://support.google.com/googleplay/android-developer/answer/14115180?hl=en
permissionsOK = permissionsOK && checkPermission(activity, Manifest.permission.READ_MEDIA_IMAGES);
permissionsOK = permissionsOK && checkPermission(activity, Manifest.permission.READ_MEDIA_VIDEO);
}
// API 33+ needs no special permissions.

return permissionsOK;
}
Expand Down