Files
SteamTools/System.Common.ClientLib.Droid/Application/Services/Implementation/PlatformTelephonyServiceImpl.cs
T
2021-02-20 16:45:44 +08:00

21 lines
734 B
C#

using Android.Content;
using Android.Telephony;
using XEPlatform = Xamarin.Essentials.Platform;
namespace System.Application.Services.Implementation
{
/// <inheritdoc cref="ITelephonyService"/>
internal sealed class PlatformTelephonyServiceImpl : TelephonyServiceImpl
{
public PlatformTelephonyServiceImpl(IPermissions pf, IPermissions.IGetPhoneNumber p1) : base(pf, p1)
{
}
protected override string? PlatformGetPhoneNumber()
{
var telephony = XEPlatform.AppContext.GetSystemService<TelephonyManager>(Context.TelephonyService);
var value = telephony.Line1Number;
return PhoneNumberHelper.GetCNMainlandPhoneNumber11(value);
}
}
}