1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-09-27 03:52:57 +02:00

[PS-2520] Restore copy confirmation toast on Android 13+ (#2388)

* Restore copy notification toast on Android 13+

* fixed space
This commit is contained in:
mp-bw 2023-02-21 10:49:24 -05:00 committed by GitHub
parent 3f72d35145
commit 6da1875ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 22 deletions

View File

@ -49,12 +49,6 @@ namespace Bit.Droid.Services
}
}
public bool IsCopyNotificationHandledByPlatform()
{
// Android 13+ provides built-in notification when text is copied to the clipboard
return (int)Build.VERSION.SdkInt >= 33;
}
private void CopyToClipboard(string text, bool isSensitive = true)
{
var clipboardManager = Application.Context.GetSystemService(Context.ClipboardService) as ClipboardManager;

View File

@ -134,11 +134,7 @@ namespace Bit.App.Services
public void ShowToastForCopiedValue(string valueNameCopied)
{
if (!_clipboardService.IsCopyNotificationHandledByPlatform())
{
ShowToast("info", null,
string.Format(AppResources.ValueHasBeenCopied, valueNameCopied));
}
ShowToast("info", null, string.Format(AppResources.ValueHasBeenCopied, valueNameCopied));
}
public bool SupportsFido2()

View File

@ -15,10 +15,5 @@ namespace Bit.Core.Abstractions
/// <param name="expiresInMs">Expiration time in milliseconds of the copied text</param>
/// <param name="isSensitive">Flag to mark copied text as sensitive</param>
Task CopyTextAsync(string text, int expiresInMs = -1, bool isSensitive = true);
/// <summary>
/// Returns true if the platform provides its own notification when text is copied to the clipboard
/// </summary>
bool IsCopyNotificationHandledByPlatform();
}
}

View File

@ -38,11 +38,5 @@ namespace Bit.iOS.Core.Services
ExpirationDate = clearSeconds > 0 ? NSDate.FromTimeIntervalSinceNow(clearSeconds) : null
}));
}
public bool IsCopyNotificationHandledByPlatform()
{
// return true for any future versions of iOS that notify the user when text is copied to the clipboard
return false;
}
}
}