Removal of deprecated Android Accessibility Service options (#698)

This commit is contained in:
Matt Portune 2020-01-10 11:34:17 -05:00 committed by Kyle Spearrin
parent 641122b16f
commit 9f06c9a051
7 changed files with 0 additions and 206 deletions

View File

@ -132,55 +132,6 @@
Text="{u:I18n BlacklistedUrisDescription}"
StyleClass="box-footer-label" />
</StackLayout>
<StackLayout StyleClass="box" IsVisible="{Binding ShowAndroidAccessibilitySettings}">
<StackLayout StyleClass="box-row-header">
<Label Text="{u:I18n AutofillAccessibilityService, Header=True}"
StyleClass="box-header, box-header-platform" />
</StackLayout>
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n AutofillAlways}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding AutofillAlwaysScan}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<Label
Text="{u:I18n AutofillAlwaysDescription}"
StyleClass="box-footer-label, box-footer-label-switch" />
</StackLayout>
<StackLayout StyleClass="box" IsVisible="{Binding ShowAndroidAccessibilitySettings}">
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n AutofillPersistNotification}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding AutofillPersistNotification}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<Label
Text="{u:I18n AutofillPersistNotificationDescription}"
StyleClass="box-footer-label, box-footer-label-switch" />
</StackLayout>
<StackLayout StyleClass="box" IsVisible="{Binding ShowAndroidAccessibilitySettings}">
<StackLayout StyleClass="box-row, box-row-switch">
<Label
Text="{u:I18n AutofillPasswordField}"
StyleClass="box-label, box-label-regular"
HorizontalOptions="StartAndExpand" />
<Switch
IsToggled="{Binding AutofillPasswordField}"
StyleClass="box-value"
HorizontalOptions="End" />
</StackLayout>
<Label
Text="{u:I18n AutofillPasswordFieldDescription}"
StyleClass="box-footer-label, box-footer-label-switch" />
</StackLayout>
</StackLayout>
</ScrollView>

View File

@ -24,7 +24,6 @@ namespace Bit.App.Pages
if(Device.RuntimePlatform == Device.Android)
{
ToolbarItems.RemoveAt(0);
_vm.ShowAndroidAccessibilitySettings = false;
_vm.ShowAndroidAutofillSettings = _deviceActionService.SupportsAutofillService();
_themeDescriptionLabel.Text = string.Concat(_themeDescriptionLabel.Text, " ",
AppResources.RestartIsRequired);

View File

@ -21,9 +21,6 @@ namespace Bit.App.Pages
private readonly IMessagingService _messagingService;
private bool _autofillAlwaysScan;
private bool _autofillPersistNotification;
private bool _autofillPasswordField;
private bool _autofillDisableSavePrompt;
private string _autofillBlacklistedUris;
private bool _disableFavicon;
@ -33,7 +30,6 @@ namespace Bit.App.Pages
private int _uriMatchSelectedIndex;
private bool _inited;
private bool _updatingAutofill;
private bool _showAndroidAccessibilitySettings;
private bool _showAndroidAutofillSettings;
public OptionsPageViewModel()
@ -144,42 +140,6 @@ namespace Bit.App.Pages
}
}
public bool AutofillAlwaysScan
{
get => _autofillAlwaysScan;
set
{
if(SetProperty(ref _autofillAlwaysScan, value))
{
var task = UpdateAutofillAsync(false, false);
}
}
}
public bool AutofillPersistNotification
{
get => _autofillPersistNotification;
set
{
if(SetProperty(ref _autofillPersistNotification, value))
{
var task = UpdateAutofillAsync(value, false);
}
}
}
public bool AutofillPasswordField
{
get => _autofillPasswordField;
set
{
if(SetProperty(ref _autofillPasswordField, value))
{
var task = UpdateAutofillAsync(false, value);
}
}
}
public bool AutofillDisableSavePrompt
{
get => _autofillDisableSavePrompt;
@ -198,12 +158,6 @@ namespace Bit.App.Pages
set => SetProperty(ref _autofillBlacklistedUris, value);
}
public bool ShowAndroidAccessibilitySettings
{
get => _showAndroidAccessibilitySettings;
set => SetProperty(ref _showAndroidAccessibilitySettings, value);
}
public bool ShowAndroidAutofillSettings
{
get => _showAndroidAutofillSettings;
@ -217,11 +171,6 @@ namespace Bit.App.Pages
var blacklistedUrisList = await _storageService.GetAsync<List<string>>(
Constants.AutofillBlacklistedUrisKey);
AutofillBlacklistedUris = blacklistedUrisList != null ? string.Join(", ", blacklistedUrisList) : null;
AutofillPersistNotification = (await _storageService.GetAsync<bool?>(
Constants.AccessibilityAutofillPersistNotificationKey)).GetValueOrDefault();
AutofillPasswordField = (await _storageService.GetAsync<bool?>(
Constants.AccessibilityAutofillPasswordFieldKey)).GetValueOrDefault();
AutofillAlwaysScan = !AutofillPersistNotification && !AutofillPasswordField;
DisableAutoTotpCopy = !(await _totpService.IsAutoCopyEnabledAsync());
DisableFavicon = (await _storageService.GetAsync<bool?>(Constants.DisableFaviconKey)).GetValueOrDefault();
var theme = await _storageService.GetAsync<string>(Constants.ThemeKey);
@ -234,35 +183,6 @@ namespace Bit.App.Pages
_inited = true;
}
private async Task UpdateAutofillAsync(bool persistNotification, bool passwordField)
{
if(_inited && !_updatingAutofill)
{
_updatingAutofill = true;
if(persistNotification)
{
AutofillAlwaysScan = false;
AutofillPasswordField = false;
}
else if(passwordField)
{
AutofillAlwaysScan = false;
AutofillPersistNotification = false;
}
else
{
AutofillAlwaysScan = true;
AutofillPersistNotification = false;
AutofillPasswordField = false;
}
await _storageService.SaveAsync(Constants.AccessibilityAutofillPersistNotificationKey,
AutofillPersistNotification);
await _storageService.SaveAsync(Constants.AccessibilityAutofillPasswordFieldKey,
AutofillPasswordField);
_updatingAutofill = false;
}
}
private async Task UpdateAutoTotpCopyAsync()
{
if(_inited)

View File

@ -339,24 +339,6 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Always Scan.
/// </summary>
public static string AutofillAlways {
get {
return ResourceManager.GetString("AutofillAlways", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always scan the screen for fields and only offer an auto-fill notification if password fields are found. This is the default setting..
/// </summary>
public static string AutofillAlwaysDescription {
get {
return ResourceManager.GetString("AutofillAlwaysDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Auto-fill and save.
/// </summary>
@ -375,42 +357,6 @@ namespace Bit.App.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Scan When Password Field Focused.
/// </summary>
public static string AutofillPasswordField {
get {
return ResourceManager.GetString("AutofillPasswordField", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Only scan the screen for fields and offer an auto-fill notification whenever you select a password field. This setting may help conserve battery life..
/// </summary>
public static string AutofillPasswordFieldDescription {
get {
return ResourceManager.GetString("AutofillPasswordFieldDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Persist Notification.
/// </summary>
public static string AutofillPersistNotification {
get {
return ResourceManager.GetString("AutofillPersistNotification", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Always offer an auto-fill notification and only scan for fields after attempting an auto-fill. This setting may help conserve battery life..
/// </summary>
public static string AutofillPersistNotificationDescription {
get {
return ResourceManager.GetString("AutofillPersistNotificationDescription", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Auto-fill Service.
/// </summary>

View File

@ -779,24 +779,6 @@
<data name="ShareVault" xml:space="preserve">
<value>Share Your Vault</value>
</data>
<data name="AutofillPasswordField" xml:space="preserve">
<value>Scan When Password Field Focused</value>
</data>
<data name="AutofillPasswordFieldDescription" xml:space="preserve">
<value>Only scan the screen for fields and offer an auto-fill notification whenever you select a password field. This setting may help conserve battery life.</value>
</data>
<data name="AutofillPersistNotification" xml:space="preserve">
<value>Persist Notification</value>
</data>
<data name="AutofillPersistNotificationDescription" xml:space="preserve">
<value>Always offer an auto-fill notification and only scan for fields after attempting an auto-fill. This setting may help conserve battery life.</value>
</data>
<data name="AutofillAlways" xml:space="preserve">
<value>Always Scan</value>
</data>
<data name="AutofillAlwaysDescription" xml:space="preserve">
<value>Always scan the screen for fields and only offer an auto-fill notification if password fields are found. This is the default setting.</value>
</data>
<data name="CannotOpenApp" xml:space="preserve">
<value>Cannot open the app "{0}".</value>
<comment>Message shown when trying to launch an app that does not exist on the user's device.</comment>

View File

@ -18,8 +18,6 @@ namespace Bit.App.Services
Constants.DisableAutoTotpCopyKey,
Constants.DisableFaviconKey,
Constants.ClearClipboardKey,
Constants.AccessibilityAutofillPasswordFieldKey,
Constants.AccessibilityAutofillPersistNotificationKey,
Constants.AutofillDisableSavePromptKey,
Constants.LastActiveKey,
Constants.PushInitialPromptShownKey,

View File

@ -13,8 +13,6 @@
public static string DisableAutoTotpCopyKey = "disableAutoTotpCopy";
public static string EnvironmentUrlsKey = "environmentUrls";
public static string LastFileCacheClearKey = "lastFileCacheClear";
public static string AccessibilityAutofillPasswordFieldKey = "accessibilityAutofillPasswordField";
public static string AccessibilityAutofillPersistNotificationKey = "accessibilityAutofillPersistNotification";
public static string AutofillDisableSavePromptKey = "autofillDisableSavePrompt";
public static string AutofillBlacklistedUrisKey = "autofillBlacklistedUris";
public static string DisableFaviconKey = "disableFavicon";