1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 16:53:26 +00:00

Clipboard handling adjustments for Android 13 (#1947)

* Android 13 clipboard tweaks

* adjustments

* adjustments round 2
This commit is contained in:
mp-bw
2022-06-10 12:02:17 -04:00
committed by GitHub
parent dd6003bd4f
commit 48a8d9ae35
13 changed files with 84 additions and 43 deletions

View File

@@ -16,8 +16,10 @@ namespace Bit.iOS.Core.Services
_stateService = stateService;
}
public async Task CopyTextAsync(string text, int expiresInMs = -1)
public async Task CopyTextAsync(string text, int expiresInMs = -1, bool isSensitive = true)
{
// isSensitive is only used by Android for now
int clearSeconds = -1;
if (expiresInMs < 0)
{
@@ -36,5 +38,11 @@ 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;
}
}
}

View File

@@ -64,8 +64,8 @@ namespace Bit.iOS.Core.Utilities
new StateMigrationService(liteDbStorage, preferencesStorage, secureStorageService);
var deviceActionService = new DeviceActionService(stateService, messagingService);
var clipboardService = new ClipboardService(stateService);
var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, messagingService,
broadcasterService);
var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, clipboardService,
messagingService, broadcasterService);
var biometricService = new BiometricService(mobileStorageService);
var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService);
var cryptoService = new CryptoService(stateService, cryptoFunctionService);