From 002d5316bba76c7da4ddfd91135b567967b493c6 Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Fri, 24 Apr 2020 13:18:46 -0400 Subject: [PATCH] Fix obsolete API usage Context: https://github.com/xamarin/java.interop/commit/fefe0cad Context: https://dev.azure.com/devdiv/DevDiv/_releaseProgress?releaseId=627533&_a=release-environment-extension&environmentId=3407492&extensionId=ms.vss-test-web.test-result-in-release-environment-editor-tab&runId=12114054&resultId=100178&paneView=attachments These projects have been failing to build against Xamarin.Android d16-6, and they can be fixed by updating their usage of obsolete APIs. --- HoneycombGallery/CameraFragment.cs | 5 ++--- .../SystemUIVisibilityDemo/Activity1.cs | 6 +++--- .../PushSample/CustomPreferencesActivity.cs | 8 ++++---- .../AndroidCipher/AndroidCipher.cs | 17 +++++++---------- .../AndroidCipher/AndroidCipher.csproj | 1 - .../LocUpdFgService/LocUpdFgService.csproj | 1 - .../LocUpdFgService/LocationUpdatesService.cs | 6 +++--- .../LocUpdPendIntent/LocUpdPendIntent.csproj | 1 - .../LocUpdPendIntent/LocUpdPendIntent/Utils.cs | 4 ++-- .../AutofillFramework/AutofillFramework.csproj | 1 - .../CreditCardExpirationDateCompoundView.cs | 12 ++++++------ .../CreditCardExpirationDatePickerView.cs | 18 +++++++++--------- .../CreditCardSpinnersActivity.cs | 2 +- .../AutofillService/AutofillHints.cs | 14 +++++++------- .../AutofillService/AutofillService.csproj | 1 - 15 files changed, 44 insertions(+), 53 deletions(-) diff --git a/HoneycombGallery/CameraFragment.cs b/HoneycombGallery/CameraFragment.cs index ff8380427..7c6d91c20 100644 --- a/HoneycombGallery/CameraFragment.cs +++ b/HoneycombGallery/CameraFragment.cs @@ -16,14 +16,13 @@ using System; using System.Collections.Generic; -using Android.Graphics; using Java.IO; using Android.App; using Android.Content; using Android.OS; using Android.Util; using Android.Views; -using Camera = Android.Hardware.Camera; +using Android.Hardware; namespace com.example.monodroid.hcgallery { @@ -54,7 +53,7 @@ public override void OnCreate (Bundle savedInstanceState) Camera.CameraInfo cameraInfo = new Camera.CameraInfo (); for (int i = 0; i < mNumberOfCameras; i++) { Camera.GetCameraInfo (i, cameraInfo); - if (cameraInfo.Facing == Camera.CameraInfo.CameraFacingBack) { + if (cameraInfo.Facing == CameraFacing.Back) { mDefaultCameraId = i; } } diff --git a/PlatformFeatures/ICS_Samples/SystemUIVisibilityDemo/SystemUIVisibilityDemo/Activity1.cs b/PlatformFeatures/ICS_Samples/SystemUIVisibilityDemo/SystemUIVisibilityDemo/Activity1.cs index 584903191..78e370d02 100644 --- a/PlatformFeatures/ICS_Samples/SystemUIVisibilityDemo/SystemUIVisibilityDemo/Activity1.cs +++ b/PlatformFeatures/ICS_Samples/SystemUIVisibilityDemo/SystemUIVisibilityDemo/Activity1.cs @@ -26,15 +26,15 @@ protected override void OnCreate (Bundle bundle) var visibleButton = FindViewById