noop device action service for ios

This commit is contained in:
Kyle Spearrin 2017-11-29 16:28:58 -05:00
parent 6985ccf076
commit d39609351a
3 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,75 @@
using System;
using Bit.App.Abstractions;
using System.Threading.Tasks;
using Bit.App.Models.Page;
namespace Bit.iOS.Core.Services
{
public class NoopDeviceActionService : IDeviceActionService
{
public void Autofill(VaultListPageModel.Cipher cipher)
{
// do nothing
}
public void Background()
{
// do nothing
}
public bool CanOpenFile(string fileName)
{
return false;
}
public void ClearCache()
{
// do nothing
}
public void CloseAutofill()
{
// do nothing
}
public void CopyToClipboard(string text)
{
// do nothing
}
public void DismissKeyboard()
{
// do nothing
}
public void LaunchApp(string appName)
{
// do nothing
}
public void OpenAccessibilitySettings()
{
// do nothing
}
public void OpenAutofillSettings()
{
// do nothing
}
public bool OpenFile(byte[] fileData, string id, string fileName)
{
return false;
}
public void RateApp()
{
// do nothing
}
public Task SelectFileAsync()
{
return Task.FromResult(0);
}
}
}

View file

@ -86,6 +86,7 @@
<Compile Include="Controllers\ExtendedUIViewController.cs" /> <Compile Include="Controllers\ExtendedUIViewController.cs" />
<Compile Include="HockeyAppCrashManagerDelegate.cs" /> <Compile Include="HockeyAppCrashManagerDelegate.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\NoopDeviceActionService.cs" />
<Compile Include="Services\DeviceInfoService.cs" /> <Compile Include="Services\DeviceInfoService.cs" />
<Compile Include="Services\KeyChainStorageService.cs" /> <Compile Include="Services\KeyChainStorageService.cs" />
<Compile Include="Services\CommonCryptoKeyDerivationService.cs" /> <Compile Include="Services\CommonCryptoKeyDerivationService.cs" />

View file

@ -290,6 +290,7 @@ namespace Bit.iOS.Extension
container.RegisterSingleton<ITokenService, TokenService>(); container.RegisterSingleton<ITokenService, TokenService>();
container.RegisterSingleton<ISettingsService, SettingsService>(); container.RegisterSingleton<ISettingsService, SettingsService>();
container.RegisterSingleton<IDeviceInfoService, DeviceInfoService>(); container.RegisterSingleton<IDeviceInfoService, DeviceInfoService>();
container.RegisterSingleton<IDeviceActionService, NoopDeviceActionService>();
container.RegisterSingleton<IAppSettingsService, AppSettingsService>(); container.RegisterSingleton<IAppSettingsService, AppSettingsService>();
// Repositories // Repositories