Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into dev/fix_location_always
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis authored Apr 4, 2022
2 parents c3d0d54 + 7bb913f commit 3f99b6e
Show file tree
Hide file tree
Showing 10 changed files with 212 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<queries>
<!-- Email -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="3.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions Samples/Samples.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<queries>
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Essentials/AppActions/AppActions.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static AppAction ToAppAction(this ShortcutInfo shortcutInfo) =>
const string extraAppActionTitle = "EXTRA_XE_APP_ACTION_TITLE";
const string extraAppActionSubtitle = "EXTRA_XE_APP_ACTION_SUBTITLE";
const string extraAppActionIcon = "EXTRA_XE_APP_ACTION_ICON";
internal const string extraAppActionHandled = "EXTRA_XE_APP_ACTION_HANDLED";

internal static AppAction ToAppAction(this Intent intent)
=> new AppAction(
Expand Down
4 changes: 0 additions & 4 deletions Xamarin.Essentials/FilePicker/FilePicker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ public static partial class FilePicker
{
static async Task<IEnumerable<FileResult>> PlatformPickAsync(PickOptions options, bool allowMultiple = false)
{
// we only need the permission when accessing the file, but it's more natural
// to ask the user first, then show the picker.
await Permissions.EnsureGrantedAsync<Permissions.StorageRead>();

// Essentials supports >= API 19 where this action is available
var action = Intent.ActionOpenDocument;

Expand Down
4 changes: 0 additions & 4 deletions Xamarin.Essentials/MediaPicker/MediaPicker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ static Task<FileResult> PlatformPickVideoAsync(MediaPickerOptions options)

static async Task<FileResult> PlatformPickAsync(MediaPickerOptions options, bool photo)
{
// We only need the permission when accessing the file, but it's more natural
// to ask the user first, then show the picker.
await Permissions.EnsureGrantedAsync<Permissions.StorageRead>();

var intent = new Intent(Intent.ActionGetContent);
intent.SetType(photo ? FileSystem.MimeTypes.ImageAll : FileSystem.MimeTypes.VideoAll);

Expand Down
5 changes: 4 additions & 1 deletion Xamarin.Essentials/Platform/Platform.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ public static void OnResume(Activity activity = null)

static void CheckAppActions(AndroidIntent intent)
{
if (intent?.Action == Intent.ActionAppAction)
if (intent?.Action == Intent.ActionAppAction && !intent.GetBooleanExtra(AppActions.extraAppActionHandled, false))
{
// prevent launch intent getting handled on activity resume
intent.PutExtra(AppActions.extraAppActionHandled, true);

var appAction = intent.ToAppAction();

if (!string.IsNullOrEmpty(appAction?.Id))
Expand Down
Loading

0 comments on commit 3f99b6e

Please sign in to comment.