diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index a33c607fb..14c081e6b 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -140,7 +140,6 @@ - diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs index 427d18128..0155c3992 100644 --- a/src/Android/MainActivity.cs +++ b/src/Android/MainActivity.cs @@ -386,7 +386,6 @@ namespace Bit.Droid { return; } - StaticStore.LastClipboardValue = data.Item1; var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + clearMs.Value; var alarmManager = GetSystemService(AlarmService) as AlarmManager; alarmManager.Set(AlarmType.Rtc, triggerMs, _clearClipboardPendingIntent); diff --git a/src/Android/Receivers/ClearClipboardAlarmReceiver.cs b/src/Android/Receivers/ClearClipboardAlarmReceiver.cs index 31420ba16..acc872354 100644 --- a/src/Android/Receivers/ClearClipboardAlarmReceiver.cs +++ b/src/Android/Receivers/ClearClipboardAlarmReceiver.cs @@ -1,8 +1,4 @@ using Android.Content; -using Bit.Core; -using Bit.Core.Abstractions; -using Bit.Core.Utilities; -using Bit.Droid.Utilities; namespace Bit.Droid.Receivers { @@ -12,11 +8,7 @@ namespace Bit.Droid.Receivers public override void OnReceive(Context context, Intent intent) { var clipboardManager = context.GetSystemService(Context.ClipboardService) as ClipboardManager; - if (StaticStore.LastClipboardValue != null && StaticStore.LastClipboardValue == clipboardManager.Text) - { - clipboardManager.Text = string.Empty; - } - StaticStore.LastClipboardValue = null; + clipboardManager.PrimaryClip = ClipData.NewPlainText("bitwarden", string.Empty); } } } diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 0715fb42b..02cee112a 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -860,7 +860,7 @@ namespace Bit.Droid.Services var activity = (MainActivity)CrossCurrentActivity.Current.Activity; var clipboardManager = activity.GetSystemService( Context.ClipboardService) as Android.Content.ClipboardManager; - clipboardManager.Text = text; + clipboardManager.PrimaryClip = ClipData.NewPlainText("bitwarden", text); } private class BiometricAuthenticationCallback : BiometricPrompt.AuthenticationCallback diff --git a/src/Android/Utilities/StaticStore.cs b/src/Android/Utilities/StaticStore.cs deleted file mode 100644 index 1be4cf9a4..000000000 --- a/src/Android/Utilities/StaticStore.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; - -namespace Bit.Droid.Utilities -{ - public static class StaticStore - { - public static string LastClipboardValue { get; set; } - } -}