From 4342b74c52b2ef1369436ca9d660da0e531ba780 Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Thu, 2 Feb 2023 12:16:02 +0100 Subject: [PATCH 1/2] Remove PhoneDialer.Default --- src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs | 9 ++------- .../src/PublicAPI/net-android/PublicAPI.Unshipped.txt | 1 + .../src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 1 + .../PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 1 + .../src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 1 + .../src/PublicAPI/net-windows/PublicAPI.Unshipped.txt | 1 + src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt | 1 + .../src/PublicAPI/netstandard/PublicAPI.Unshipped.txt | 1 + 8 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs index 6b5cb34a1365..6ecf90a8f6b5 100644 --- a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs +++ b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs @@ -50,16 +50,11 @@ public static class PhoneDialer public static void Open(string number) => Current.Open(number); - public static IPhoneDialer Current => ApplicationModel.Communication.PhoneDialer.Default; + public static IPhoneDialer Current => + defaultImplementation ??= new PhoneDialerImplementation(); static IPhoneDialer? defaultImplementation; - /// - /// Provides the default implementation for static usage of this API. - /// - public static IPhoneDialer Default => - defaultImplementation ??= new PhoneDialerImplementation(); - internal static void SetDefault(IPhoneDialer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt index 1e2c3171b21e..17da419e3e02 100644 --- a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! diff --git a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 1e2c3171b21e..b13deacdb636 100644 --- a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -3,3 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file From dd8825ae21c18684461e7c684619c5d4067574ea Mon Sep 17 00:00:00 2001 From: Gerald Versluis Date: Fri, 3 Feb 2023 13:28:42 +0100 Subject: [PATCH 2/2] Add Default, remove Current --- .../src/PhoneDialer/PhoneDialer.shared.cs | 13 ++++++++----- .../PublicAPI/net-android/PublicAPI.Unshipped.txt | 2 +- .../src/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 2 +- .../net-maccatalyst/PublicAPI.Unshipped.txt | 2 +- .../src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 2 +- .../PublicAPI/net-windows/PublicAPI.Unshipped.txt | 2 +- .../src/PublicAPI/net/PublicAPI.Unshipped.txt | 2 +- .../PublicAPI/netstandard/PublicAPI.Unshipped.txt | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs index 6ecf90a8f6b5..47cf6541640f 100644 --- a/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs +++ b/src/Essentials/src/PhoneDialer/PhoneDialer.shared.cs @@ -35,7 +35,7 @@ public static class PhoneDialer /// Gets a value indicating whether using the phone dialer is supported on this device. /// public static bool IsSupported => - Current.IsSupported; + Default.IsSupported; /// /// Open the phone dialer to a specific phone number. @@ -48,13 +48,16 @@ public static class PhoneDialer /// Thrown if making phone calls is not supported on the device. /// Phone number to initialize the dialer with. public static void Open(string number) - => Current.Open(number); - - public static IPhoneDialer Current => - defaultImplementation ??= new PhoneDialerImplementation(); + => Default.Open(number); static IPhoneDialer? defaultImplementation; + /// + /// Provides the default implementation for static usage of this API. + /// + public static IPhoneDialer Default => + defaultImplementation ??= new PhoneDialerImplementation(); + internal static void SetDefault(IPhoneDialer? implementation) => defaultImplementation = implementation; } diff --git a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file diff --git a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt index 17da419e3e02..91425e976dab 100644 --- a/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! diff --git a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index b13deacdb636..19a93b695874 100644 --- a/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Essentials/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -3,4 +3,4 @@ *REMOVED*static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! Microsoft.Maui.Storage.ISecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! static Microsoft.Maui.Storage.SecureStorage.GetAsync(string! key) -> System.Threading.Tasks.Task! -*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Default.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file +*REMOVED*static Microsoft.Maui.ApplicationModel.Communication.PhoneDialer.Current.get -> Microsoft.Maui.ApplicationModel.Communication.IPhoneDialer! \ No newline at end of file