mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-21 09:02:26 +08:00
21 lines
734 B
C#
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);
|
|
}
|
|
}
|
|
} |