mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 14:51:44 +01:00
Removed Android Baackground Service
This commit is contained in:
parent
530112ccc6
commit
1d0abbcff7
@ -76,11 +76,7 @@
|
|||||||
<Compile Include="PlatformInitializer.cs" />
|
<Compile Include="PlatformInitializer.cs" />
|
||||||
<Compile Include="Resources\Resource.designer.cs" />
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\APIBinder.cs" />
|
|
||||||
<Compile Include="Services\APIBindedService.cs" />
|
|
||||||
<Compile Include="Services\APIService.cs" />
|
<Compile Include="Services\APIService.cs" />
|
||||||
<Compile Include="Services\APIService_New.cs" />
|
|
||||||
<Compile Include="Services\APIServiceConnection.cs" />
|
|
||||||
<Compile Include="Services\BrowserService.cs" />
|
<Compile Include="Services\BrowserService.cs" />
|
||||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||||
<Compile Include="Services\SecretStorage.cs" />
|
<Compile Include="Services\SecretStorage.cs" />
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
using Android.App;
|
|
||||||
using Android.Content;
|
|
||||||
using Android.OS;
|
|
||||||
using FabAccessAPI;
|
|
||||||
|
|
||||||
namespace Borepin.Droid.Services
|
|
||||||
{
|
|
||||||
[Service(Name= "org.fab_infra.fabaccess.APIService")]
|
|
||||||
public class APIBindedService : Android.App.Service
|
|
||||||
{
|
|
||||||
#region Private Members
|
|
||||||
private IAPI _API;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Members
|
|
||||||
public IBinder Binder { get; private set; }
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Methods
|
|
||||||
public IAPI GetAPI()
|
|
||||||
{
|
|
||||||
return _API;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnCreate()
|
|
||||||
{
|
|
||||||
base.OnCreate();
|
|
||||||
_API = new API();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override IBinder OnBind(Intent intent)
|
|
||||||
{
|
|
||||||
Binder = new APIBinder(this);
|
|
||||||
return Binder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override bool OnUnbind(Intent intent)
|
|
||||||
{
|
|
||||||
return base.OnUnbind(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnDestroy()
|
|
||||||
{
|
|
||||||
Binder = null;
|
|
||||||
_API = null;
|
|
||||||
base.OnDestroy();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
using Android.OS;
|
|
||||||
|
|
||||||
namespace Borepin.Droid.Services
|
|
||||||
{
|
|
||||||
public class APIBinder : Binder
|
|
||||||
{
|
|
||||||
#region Constructors
|
|
||||||
public APIBinder(APIBindedService service)
|
|
||||||
{
|
|
||||||
Service = service;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Members
|
|
||||||
public APIBindedService Service { get; private set; }
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
using Android.Content;
|
|
||||||
using Android.OS;
|
|
||||||
using FabAccessAPI;
|
|
||||||
|
|
||||||
namespace Borepin.Droid.Services
|
|
||||||
{
|
|
||||||
class APIServiceConnection : Java.Lang.Object, IServiceConnection
|
|
||||||
{
|
|
||||||
#region Members
|
|
||||||
public bool IsConnected
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Binder != null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public APIBinder Binder { get; private set; } = null;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Methods
|
|
||||||
public void OnServiceConnected(ComponentName name, IBinder service)
|
|
||||||
{
|
|
||||||
Binder = service as APIBinder;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnServiceDisconnected(ComponentName name)
|
|
||||||
{
|
|
||||||
Binder = null;
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
using Android.App;
|
|
||||||
using Android.Content;
|
|
||||||
using Borepin.Service;
|
|
||||||
using FabAccessAPI;
|
|
||||||
|
|
||||||
namespace Borepin.Droid.Services
|
|
||||||
{
|
|
||||||
public class APIService_New : IAPIService
|
|
||||||
{
|
|
||||||
#region Private Members
|
|
||||||
private readonly APIServiceConnection _APIServiceConnection;
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
public APIService_New()
|
|
||||||
{
|
|
||||||
Context context = Application.Context;
|
|
||||||
Intent service = new Intent(context, typeof(APIBindedService));
|
|
||||||
context.BindService(service, _APIServiceConnection, Bind.AutoCreate);
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public IAPI GetAPI()
|
|
||||||
{
|
|
||||||
return _APIServiceConnection?.Binder?.Service?.GetAPI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user