From 862083c0be71df4a6c28aa4c73dd22df9a723b44 Mon Sep 17 00:00:00 2001 From: Philipp Crocoll Date: Mon, 29 Jun 2020 12:02:45 +0200 Subject: [PATCH] only show Google Drive option if device has PlayServices available --- src/keepass2android/app/App.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/keepass2android/app/App.cs b/src/keepass2android/app/App.cs index d5ae92c0..99b8efb2 100644 --- a/src/keepass2android/app/App.cs +++ b/src/keepass2android/app/App.cs @@ -46,6 +46,7 @@ using KeePassLib.Interfaces; using KeePassLib.Utility; #if !NoNet #if !EXCLUDE_JAVAFILESTORAGE +using Android.Gms.Common; using Keepass2android.Javafilestorage; using GoogleDriveFileStorage = keepass2android.Io.GoogleDriveFileStorage; using PCloudFileStorage = keepass2android.Io.PCloudFileStorage; @@ -702,7 +703,7 @@ namespace keepass2android #if !NoNet new DropboxFileStorage(Application.Context, this), new DropboxAppFolderFileStorage(Application.Context, this), - new GoogleDriveFileStorage(Application.Context, this), + GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(Application.Context)==ConnectionResult.Success ? new GoogleDriveFileStorage(Application.Context, this) : null, new OneDriveFileStorage(Application.Context, this), new OneDrive2FullFileStorage(), new OneDrive2MyFilesFileStorage(), @@ -716,7 +717,7 @@ namespace keepass2android #endif #endif new LocalFileStorage(this) - }; + }.Where(fs => fs != null).ToList(); } return _fileStorages; }