From 8ff139f945b625cf514ebdd6691c9f33c10fee3c Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 18 Jan 2018 08:53:01 +0900 Subject: [PATCH] [enumification][Mono.Android] Fix ChoiceMode enum generation. (#1183) Fixes: https://github.com/xamarin/xamarin-android/issues/1170 Context: https://github.com/xamarin/xamarin-android/commit/a301764a8866850bd4b7923e8354a596a2d598b1 Bumps to xamarin-android-api-compatibility/master/6874e3f3 Xamarin.Android 8.1 (d15-5) provides an `Android.Widget.ChoiceMode` enum type in API-10+, used by the `Android.Widget.ListView.ChoiceMode` property. `ChoiceMode` contains the `android.widget.ListView.CHOICE_MODE_*` constants from API-10, which were moved to `android.widget.AbsListView` in API-15. Xamarin.Android 8.2 (d15-6) inadvertently *removed* the `Android.Widget.ChoiceMode` enum, because [xamarin-android/a301764a][xa-a301764a] altered the mapping of the `CHOICE_MODE` constants so that they were only bound into the `Android.Widget.ChoiceMode` enum for API-15+. [xa-a301764a]: https://github.com/xamarin/xamarin-android/commit/a301764a8866850bd4b7923e8354a596a2d598b1 Removing the `ChoiceMode` enum in turn caused the `ListView.ChoiceMode` property to be removed, as the `ListView.getChoiceMode()` and `ListView.setChoiceMode()` methods expected the (now nonexistent) `ChoiceMode` enum type. Update `map.csv` so that the `CHOICE_MODE_*` values are mapped to the `ChoiceMode` enum in API-10+, not API-15+, which restores the `Android.Widget.ChoiceMode` enum type and the `ListView.ChoiceMode` property. --- .../enumification-helpers/enum-conversion-mappings.xml | 3 ++- external/xamarin-android-api-compatibility | 2 +- src/Mono.Android/map.csv | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build-tools/enumification-helpers/enum-conversion-mappings.xml b/build-tools/enumification-helpers/enum-conversion-mappings.xml index 54d7db80813..1cb34889ca0 100644 --- a/build-tools/enumification-helpers/enum-conversion-mappings.xml +++ b/build-tools/enumification-helpers/enum-conversion-mappings.xml @@ -842,7 +842,8 @@ - + + diff --git a/external/xamarin-android-api-compatibility b/external/xamarin-android-api-compatibility index 6a262943294..6874e3f320b 160000 --- a/external/xamarin-android-api-compatibility +++ b/external/xamarin-android-api-compatibility @@ -1 +1 @@ -Subproject commit 6a26294329428a1369462bba32e91d5c83164994 +Subproject commit 6874e3f320bc263072214c9ae1527ae186e0d51d diff --git a/src/Mono.Android/map.csv b/src/Mono.Android/map.csv index daf14613097..34e6728913c 100644 --- a/src/Mono.Android/map.csv +++ b/src/Mono.Android/map.csv @@ -2967,10 +2967,6 @@ 27,Android.Webkit.SafeBrowsingThreat,Phishing,android/webkit/WebViewClient.SAFE_BROWSING_THREAT_PHISHING,2 27,Android.Webkit.SafeBrowsingThreat,Unknown,android/webkit/WebViewClient.SAFE_BROWSING_THREAT_UNKNOWN,0 27,Android.Webkit.SafeBrowsingThreat,UnwantedSoftware,android/webkit/WebViewClient.SAFE_BROWSING_THREAT_UNWANTED_SOFTWARE,3 -15,Android.Widget.ChoiceMode,Multiple,android/widget/AbsListView.CHOICE_MODE_MULTIPLE,2 -15,Android.Widget.ChoiceMode,MultipleModal,android/widget/AbsListView.CHOICE_MODE_MULTIPLE_MODAL,3 -15,Android.Widget.ChoiceMode,None,android/widget/AbsListView.CHOICE_MODE_NONE,0 -15,Android.Widget.ChoiceMode,Single,android/widget/AbsListView.CHOICE_MODE_SINGLE,1 10,Android.Widget.TranscriptMode,AlwaysScroll,android/widget/AbsListView.TRANSCRIPT_MODE_ALWAYS_SCROLL,2 10,Android.Widget.TranscriptMode,Disabled,android/widget/AbsListView.TRANSCRIPT_MODE_DISABLED,0 10,Android.Widget.TranscriptMode,Normal,android/widget/AbsListView.TRANSCRIPT_MODE_NORMAL,1 @@ -5095,6 +5091,10 @@ 27,Android.Views.FeedbackConstants,VirtualKeyRelease,android/view/HapticFeedbackConstants.VIRTUAL_KEY_RELEASE,8 10,Android.Views.FeedbackFlags,IgnoreGlobalSetting,android/view/HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING,2 10,Android.Views.FeedbackFlags,IgnoreViewSetting,android/view/HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING,1 +10,Android.Widget.ChoiceMode,Multiple,android/widget/ListView.CHOICE_MODE_MULTIPLE,2 +10,Android.Widget.ChoiceMode,None,android/widget/ListView.CHOICE_MODE_NONE,0 +10,Android.Widget.ChoiceMode,Single,android/widget/ListView.CHOICE_MODE_SINGLE,1 +15,Android.Widget.ChoiceMode,MultipleModal,android/widget/AbsListView.CHOICE_MODE_MULTIPLE_MODAL,3 24,Android.AccessibilityServices.AccessibilityServiceShowMode,Auto,android/accessibilityservice/AccessibilityService.SHOW_MODE_AUTO,0 24,Android.AccessibilityServices.AccessibilityServiceShowMode,Hidden,android/accessibilityservice/AccessibilityService.SHOW_MODE_HIDDEN,1 24,Android.App.Admin.BugReportFailureReason,FailedCompleting,android/app/admin/DeviceAdminReceiver.BUGREPORT_FAILURE_FAILED_COMPLETING,0