mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-21 17:13:09 +08:00
46de667c17
优化发布配置 优化电话服务
21 lines
739 B
C#
21 lines
739 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.GetChineseMainlandPhoneNumber11(value);
|
|
}
|
|
}
|
|
} |