mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 23:25:45 +03:00
Fixed clipboard not clearing on Android 10 (#851)
This commit is contained in:
parent
0f35885d1c
commit
9a403ba0ed
5 changed files with 2 additions and 31 deletions
|
@ -140,7 +140,6 @@
|
||||||
<Compile Include="Tiles\MyVaultTileService.cs" />
|
<Compile Include="Tiles\MyVaultTileService.cs" />
|
||||||
<Compile Include="Utilities\AndroidHelpers.cs" />
|
<Compile Include="Utilities\AndroidHelpers.cs" />
|
||||||
<Compile Include="Utilities\AppCenterHelper.cs" />
|
<Compile Include="Utilities\AppCenterHelper.cs" />
|
||||||
<Compile Include="Utilities\StaticStore.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidAsset Include="Assets\FontAwesome.ttf" />
|
<AndroidAsset Include="Assets\FontAwesome.ttf" />
|
||||||
|
|
|
@ -386,7 +386,6 @@ namespace Bit.Droid
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
StaticStore.LastClipboardValue = data.Item1;
|
|
||||||
var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + clearMs.Value;
|
var triggerMs = Java.Lang.JavaSystem.CurrentTimeMillis() + clearMs.Value;
|
||||||
var alarmManager = GetSystemService(AlarmService) as AlarmManager;
|
var alarmManager = GetSystemService(AlarmService) as AlarmManager;
|
||||||
alarmManager.Set(AlarmType.Rtc, triggerMs, _clearClipboardPendingIntent);
|
alarmManager.Set(AlarmType.Rtc, triggerMs, _clearClipboardPendingIntent);
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Bit.Core;
|
|
||||||
using Bit.Core.Abstractions;
|
|
||||||
using Bit.Core.Utilities;
|
|
||||||
using Bit.Droid.Utilities;
|
|
||||||
|
|
||||||
namespace Bit.Droid.Receivers
|
namespace Bit.Droid.Receivers
|
||||||
{
|
{
|
||||||
|
@ -12,11 +8,7 @@ namespace Bit.Droid.Receivers
|
||||||
public override void OnReceive(Context context, Intent intent)
|
public override void OnReceive(Context context, Intent intent)
|
||||||
{
|
{
|
||||||
var clipboardManager = context.GetSystemService(Context.ClipboardService) as ClipboardManager;
|
var clipboardManager = context.GetSystemService(Context.ClipboardService) as ClipboardManager;
|
||||||
if (StaticStore.LastClipboardValue != null && StaticStore.LastClipboardValue == clipboardManager.Text)
|
clipboardManager.PrimaryClip = ClipData.NewPlainText("bitwarden", string.Empty);
|
||||||
{
|
|
||||||
clipboardManager.Text = string.Empty;
|
|
||||||
}
|
|
||||||
StaticStore.LastClipboardValue = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -860,7 +860,7 @@ namespace Bit.Droid.Services
|
||||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||||
var clipboardManager = activity.GetSystemService(
|
var clipboardManager = activity.GetSystemService(
|
||||||
Context.ClipboardService) as Android.Content.ClipboardManager;
|
Context.ClipboardService) as Android.Content.ClipboardManager;
|
||||||
clipboardManager.Text = text;
|
clipboardManager.PrimaryClip = ClipData.NewPlainText("bitwarden", text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class BiometricAuthenticationCallback : BiometricPrompt.AuthenticationCallback
|
private class BiometricAuthenticationCallback : BiometricPrompt.AuthenticationCallback
|
||||||
|
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue