Skip to content

Commit

Permalink
[Mono.Android] Fix missing enum issues that cause BG8800 warnings. (#…
Browse files Browse the repository at this point in the history
…8707)

Fixes: #8703

#8730 reported that we did not bind
[`HardwareBuffer.create(int width, int height, int format, int layers, long usage)`][0].

Indeed, in the build logs for `src/Mono.Android`, there is a BG8800
warning about it!

	obj/Debug/net9.0/android-34/mcw/api-34.xml(32327,10): warning BG8800:
	  Unknown parameter type 'Android.Hardware.HardwareBufferUsage' for member
	  'Android.Hardware.HardwareBuffer.Create (int, int, Android.Hardware.HardwareBufferFormat, int, Android.Hardware.HardwareBufferUsage)'

The BG8800 was generated because we attempted to map `long usage` to
an `enum`, but no enum was created as the values are of type `long`,
not `int`.

Manually create a `long`-based `HardwareBufferUsage` enum:

	[Flags]
	/* partial */ enum HardwareBufferUsage : long {
	    None = 0,
	    UsageComposerOverlay = 0x800,
	    // …
	}

However, `generator` does not support `long` enums, and generates
marshalling code using an `int`.  Thus, we need to manually bind
`HardwareBuffer.create()` and [`HardwareBuffer.getUsage()`][1] so we
can replace the `int` machinery with `long`.

While we're at it, audit all of the `BG8800` warnings that are caused
by improper enumification and fix them:

	warning BG8800: Unknown parameter type 'Android.Hardware.HardwareBufferUsage' for member 'Android.Hardware.HardwareBuffer.Create (int, int, Android.Hardware.HardwareBufferFormat, int, Android.Hardware.Hardw...
	warning BG8800: Unknown parameter type 'Android.Hardware.HardwareBufferUsage' for member 'Android.Hardware.HardwareBuffer.IsSupported (int, int, Android.Hardware.HardwareBufferFormat, int, Android.Hardware....
	warning BG8800: Unknown parameter type 'Android.App.Bind' for member 'Android.Content.Context'.
	warning BG8800: Unknown parameter type 'Android.App.Bind' for member 'Android.Content.Context.BindIsolatedService (Android.Content.Intent, Android.App.Bind, java.lang.String, java.util.concurrent.Executor, ...
	warning BG8800: Unknown parameter type 'Android.Graphics.ImageDecoderAllocatorType' for member 'Android.Graphics.ImageDecoder.SetAllocator (Android.Graphics.ImageDecoderAllocatorType)'.
	warning BG8800: Unknown parameter type 'Android.Net.WpsFailureReason' for member 'Android.Net.Wifi.WifiManager.WpsCallback.OnFailed (Android.Net.WpsFailureReason)'.
	warning BG8800: Unknown parameter type 'Android.OS.DeviceTemperatureSource' for member 'Android.OS.HardwarePropertiesManager.GetDeviceTemperatures (Android.OS.DeviceTemperatureType, Android.OS.DeviceTempera...
	warning BG8800: Unknown parameter type 'Android.Telephony.Mbms.DownloadStatus' for member 'Android.Telephony.Mbms.DownloadStatusListener.OnStatusUpdated (Android.Telephony.Mbms.DownloadRequest, Android.Tel...
	warning BG8800: Unknown parameter type 'Android.Telephony.StreamingMethod' for member 'Android.Telephony.Mbms.StreamingServiceCallback.OnStreamMethodUpdated (Android.Telephony.StreamingMethod)'.
	warning BG8800: Unknown parameter type 'Android.Telephony.StreamingState' for member 'Android.Telephony.Mbms.StreamingServiceCallback.OnStreamStateUpdated (Android.Telephony.StreamingState, Android.Telepho...
	warning BG8800: Unknown parameter type 'Android.Icu.Text.CollatorReorderCodes' for member 'Android.Icu.Text.Collator.GetEquivalentReorderCodes (Android.Icu.Text.CollatorReorderCodes)'.
	warning BG8800: Unknown parameter type 'params Android.Icu.Text.CollatorReorderCodes[]' for member 'Android.Icu.Text.Collator.SetReorderCodes (params Android.Icu.Text.CollatorReorderCodes[])'.

This results in new API being surfaced that was previously not being
bound, requiring updates to
`src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt`.

One of these new APIs is [`WpsCallback.OnFailed(WpsFailureReason)`][2],
which is a *new* `abstract` method on an existing non-`abstract` type.
Although this is a breaking change, this type previously could not have
been inherited from as the Java-side `abstract` method would not have
been implemented; consider this C# code:

	// This C# code compiles, no warnings or errors:
	class MyCallback : Android.Net.Wifi.WifiManager.WpsCallback {
	    public override void OnStarted(string? pin) {}
	    public override void OnSucceeded() {}
	}

However, the `.csproj` containing `MyCallback` will fail to build:

	obj/Debug/net8.0-android/android/src/crc64475861335642e0f6/MyCallback.java(4,8):
	  javac error JAVAC0000:
	  error: MyCallback is not abstract and does not override abstract method onFailed(int) in WpsCallback

Thus, add it as an "acceptable breakage".

[0]: https://developer.android.com/reference/android/hardware/HardwareBuffer?hl=en#create(int,%20int,%20int,%20int,%20long)
[1]: https://developer.android.com/reference/android/hardware/HardwareBuffer?hl=en#getUsage()
[2]: https://developer.android.com/reference/android/net/wifi/WifiManager.WpsCallback?hl=en#onFailed(int)
jpobst authored Mar 13, 2024
1 parent dd6e707 commit c20d51f
Showing 10 changed files with 239 additions and 22 deletions.
44 changes: 44 additions & 0 deletions src/Mono.Android/Android.Hardware/HardwareBuffer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Android.Runtime;
using Java.Interop;

namespace Android.Hardware;

public partial class HardwareBuffer
{
// These are manually bound because we do not have a way to bind the `long` enum values.
// generator treats them as int, like:
// __args [4] = new JniArgumentValue ((int) usage);

// Metadata.xml XPath method reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/method[@name='create' and count(parameter)=5 and parameter[1][@type='int'] and parameter[2][@type='int'] and parameter[3][@type='int'] and parameter[4][@type='int'] and parameter[5][@type='long']]"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
[Register ("create", "(IIIIJ)Landroid/hardware/HardwareBuffer;", "", ApiSince = 26)]
public static unsafe Android.Hardware.HardwareBuffer Create (int width, int height, [global::Android.Runtime.GeneratedEnum] Android.Hardware.HardwareBufferFormat format, int layers, Android.Hardware.HardwareBufferUsage usage)
{
const string __id = "create.(IIIIJ)Landroid/hardware/HardwareBuffer;";
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [5];
__args [0] = new JniArgumentValue (width);
__args [1] = new JniArgumentValue (height);
__args [2] = new JniArgumentValue ((int) format);
__args [3] = new JniArgumentValue (layers);
__args [4] = new JniArgumentValue ((long) usage);
var __rm = _members.StaticMethods.InvokeObjectMethod (__id, __args);
return global::Java.Lang.Object.GetObject<Android.Hardware.HardwareBuffer> (__rm.Handle, JniHandleOwnership.TransferLocalRef)!;
} finally {
}
}

[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
public unsafe Android.Hardware.HardwareBufferUsage Usage {
// Metadata.xml XPath method reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/method[@name='getUsage' and count(parameter)=0]"
[Register ("getUsage", "()J", "", ApiSince = 26)]
get {
const string __id = "getUsage.()J";
try {
var __rm = _members.InstanceMethods.InvokeAbstractInt64Method (__id, this, null);
return (Android.Hardware.HardwareBufferUsage) __rm!;
} finally {
}
}
}
}
64 changes: 64 additions & 0 deletions src/Mono.Android/Android.Hardware/HardwareBufferUsage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
namespace Android.Hardware;

[System.Flags]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
public enum HardwareBufferUsage : long
{
None = 0,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_COMPOSER_OVERLAY']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android33.0")]
UsageComposerOverlay = 2048,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_CPU_READ_OFTEN']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageCpuReadOften = 3,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_CPU_READ_RARELY']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageCpuReadRarely = 2,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_CPU_WRITE_OFTEN']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageCpuWriteOften = 48,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_CPU_WRITE_RARELY']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageCpuWriteRarely = 32,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_FRONT_BUFFER']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android33.0")]
UsageFrontBuffer = 4294967296,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_GPU_COLOR_OUTPUT']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageGpuColorOutput = 512,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_GPU_CUBE_MAP']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
UsageGpuCubeMap = 33554432,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_GPU_DATA_BUFFER']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageGpuDataBuffer = 16777216,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_GPU_MIPMAP_COMPLETE']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
UsageGpuMipmapComplete = 67108864,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_GPU_SAMPLED_IMAGE']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageGpuSampledImage = 256,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_PROTECTED_CONTENT']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageProtectedContent = 16384,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_SENSOR_DIRECT_DATA']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageSensorDirectData = 8388608,

// Metadata.xml XPath field reference: path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/field[@name='USAGE_VIDEO_ENCODE']"
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android26.0")]
UsageVideoEncode = 65536
}
24 changes: 24 additions & 0 deletions src/Mono.Android/Android.Telephony.Mbms/StreamingService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Android.Runtime;

namespace Android.Telephony.Mbms;

public partial class StreamingService
{
// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony.mbms']/class[@name='StreamingService']/field[@name='STATE_STALLED']"
[Register ("STATE_STALLED", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in a future version. Use Android.Telephony.StreamingState enum directly instead of this field.", error: true)]
public const int StateStalled = 3;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony.mbms']/class[@name='StreamingService']/field[@name='STATE_STARTED']"
[Register ("STATE_STARTED", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in a future version. Use Android.Telephony.StreamingState enum directly instead of this field.", error: true)]
public const int StateStarted = 2;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony.mbms']/class[@name='StreamingService']/field[@name='STATE_STOPPED']"
[Register ("STATE_STOPPED", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in a future version. Use Android.Telephony.StreamingState enum directly instead of this field.", error: true)]
public const int StateStopped = 1;
}
41 changes: 41 additions & 0 deletions src/Mono.Android/Android.Telephony/MbmsDownloadSession.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Android.Runtime;

namespace Android.Telephony;

public partial class MbmsDownloadSession
{
// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony']/class[@name='MbmsDownloadSession']/field[@name='STATUS_ACTIVELY_DOWNLOADING']"
[Register ("STATUS_ACTIVELY_DOWNLOADING", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in the future version. Use Android.Telephony.Mbms.DownloadStatus enum directly instead of this field.", error: true)]
public const int StatusActivelyDownloading = 1;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony']/class[@name='MbmsDownloadSession']/field[@name='STATUS_PENDING_DOWNLOAD']"
[Register ("STATUS_PENDING_DOWNLOAD", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in the future version. Use Android.Telephony.Mbms.DownloadStatus enum directly instead of this field.", error: true)]
public const int StatusPendingDownload = 2;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony']/class[@name='MbmsDownloadSession']/field[@name='STATUS_PENDING_DOWNLOAD_WINDOW']"
[Register ("STATUS_PENDING_DOWNLOAD_WINDOW", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in the future version. Use Android.Telephony.Mbms.DownloadStatus enum directly instead of this field.", error: true)]
public const int StatusPendingDownloadWindow = 4;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony']/class[@name='MbmsDownloadSession']/field[@name='STATUS_PENDING_REPAIR']"
[Register ("STATUS_PENDING_REPAIR", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in the future version. Use Android.Telephony.Mbms.DownloadStatus enum directly instead of this field.", error: true)]
public const int StatusPendingRepair = 3;

// Metadata.xml XPath field reference: path="/api/package[@name='android.telephony']/class[@name='MbmsDownloadSession']/field[@name='STATUS_UNKNOWN']"
[Register ("STATUS_UNKNOWN", ApiSince = 28)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android28.0")]
[global::System.Obsolete (@"This constant will be removed in the future version. Use Android.Telephony.Mbms.DownloadStatus enum directly instead of this field.", error: true)]
public const int StatusUnknown = 0;
}
4 changes: 4 additions & 0 deletions src/Mono.Android/Mono.Android.csproj
Original file line number Diff line number Diff line change
@@ -80,12 +80,16 @@
</Compile>
<Compile Include="Android.Content.PM\PackageManager.cs" />
<Compile Include="Android.Graphics\PathIterator.cs" />
<Compile Include="Android.Hardware\HardwareBuffer.cs" />
<Compile Include="Android.Hardware\HardwareBufferUsage.cs" />
<Compile Include="Android.Icu\ListFormatter.cs" />
<Compile Include="Android.Icu\RelativeDateTimeFormatter.cs" />
<Compile Include="Android.Icu\DateIntervalFormat.cs" />
<Compile Include="Android.Runtime\DynamicMethodNameCounter.cs" />
<Compile Include="Android.Runtime\IJavaObjectValueMarshaler.cs" />
<Compile Include="Android.Telecom\InCallService.cs" />
<Compile Include="Android.Telephony.Mbms\StreamingService.cs" />
<Compile Include="Android.Telephony\MbmsDownloadSession.cs" />
<Compile Include="Android.Views\WindowManagerLayoutParams.cs" />
<Compile Include="Java.Lang.Invoke\MethodType.cs" />
<Compile Include="Java.Time.Chrono\AbstractChronology.cs" />
43 changes: 42 additions & 1 deletion src/Mono.Android/PublicAPI/API-34/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
#nullable enable
#nullable enable
abstract Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason reason) -> void
Android.Graphics.ImageDecoder.Allocator.get -> Android.Graphics.ImageDecoderAllocator
Android.Graphics.ImageDecoder.Allocator.set -> void
Android.Hardware.HardwareBuffer.Usage.get -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.None = 0 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageComposerOverlay = 2048 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageCpuReadOften = 3 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageCpuReadRarely = 2 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageCpuWriteOften = 48 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageCpuWriteRarely = 32 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageFrontBuffer = 4294967296 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageGpuColorOutput = 512 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageGpuCubeMap = 33554432 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageGpuDataBuffer = 16777216 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageGpuMipmapComplete = 67108864 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageGpuSampledImage = 256 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageProtectedContent = 16384 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageSensorDirectData = 8388608 -> Android.Hardware.HardwareBufferUsage
Android.Hardware.HardwareBufferUsage.UsageVideoEncode = 65536 -> Android.Hardware.HardwareBufferUsage
Android.Telephony.Mbms.DownloadStatus
Android.Telephony.Mbms.DownloadStatus.ActivelyDownloading = 1 -> Android.Telephony.Mbms.DownloadStatus
Android.Telephony.Mbms.DownloadStatus.PendingDownload = 2 -> Android.Telephony.Mbms.DownloadStatus
Android.Telephony.Mbms.DownloadStatus.PendingDownloadWindow = 4 -> Android.Telephony.Mbms.DownloadStatus
Android.Telephony.Mbms.DownloadStatus.PendingRepair = 3 -> Android.Telephony.Mbms.DownloadStatus
Android.Telephony.Mbms.DownloadStatus.Unknown = 0 -> Android.Telephony.Mbms.DownloadStatus
Android.Telephony.StreamingState
Android.Telephony.StreamingState.Stalled = 3 -> Android.Telephony.StreamingState
Android.Telephony.StreamingState.Started = 2 -> Android.Telephony.StreamingState
Android.Telephony.StreamingState.Stopped = 1 -> Android.Telephony.StreamingState
static Android.Hardware.HardwareBuffer.Create(int width, int height, Android.Hardware.HardwareBufferFormat format, int layers, Android.Hardware.HardwareBufferUsage usage) -> Android.Hardware.HardwareBuffer!
static Android.Hardware.HardwareBuffer.IsSupported(int width, int height, Android.Hardware.HardwareBufferFormat format, int layers, long usage) -> bool
static Android.Icu.Text.Collator.GetEquivalentReorderCodes(int reorderCode) -> int[]?
virtual Android.Content.Context.BindIsolatedService(Android.Content.Intent! service, Android.Content.Context.BindServiceFlags! flags, string! instanceName, Java.Util.Concurrent.IExecutor! executor, Android.Content.IServiceConnection! conn) -> bool
virtual Android.Content.Context.BindIsolatedService(Android.Content.Intent! service, int flags, string! instanceName, Java.Util.Concurrent.IExecutor! executor, Android.Content.IServiceConnection! conn) -> bool
virtual Android.Icu.Text.Collator.GetReorderCodes() -> int[]?
virtual Android.Icu.Text.Collator.SetReorderCodes(params int[]? order) -> void
virtual Android.OS.HardwarePropertiesManager.GetDeviceTemperatures(Android.OS.DeviceTemperatureType type, Android.OS.TemperatureSource source) -> float[]!
virtual Android.Telephony.Mbms.DownloadStatusListener.OnStatusUpdated(Android.Telephony.Mbms.DownloadRequest? request, Android.Telephony.Mbms.FileInfo? fileInfo, Android.Telephony.Mbms.DownloadStatus status) -> void
virtual Android.Telephony.Mbms.StreamingServiceCallback.OnStreamMethodUpdated(Android.Telephony.Mbms.StreamingMethod methodType) -> void
virtual Android.Telephony.Mbms.StreamingServiceCallback.OnStreamStateUpdated(Android.Telephony.StreamingState state, Android.Telephony.Mbms.StreamingStateChangedReason reason) -> void
16 changes: 8 additions & 8 deletions src/Mono.Android/map.csv
Original file line number Diff line number Diff line change
@@ -13581,9 +13581,9 @@ E,28,android/telephony/mbms/StreamingService.REASON_LEFT_MBMS_BROADCAST_AREA,6,A
E,28,android/telephony/mbms/StreamingService.REASON_NONE,0,Android.Telephony.Mbms.StreamingStateChangedReason,None,remove,
E,28,android/telephony/mbms/StreamingService.REASON_NOT_CONNECTED_TO_HOMECARRIER_LTE,5,Android.Telephony.Mbms.StreamingStateChangedReason,NotConnectedToHomecarrierLte,remove,
E,28,android/telephony/mbms/StreamingService.REASON_OUT_OF_MEMORY,4,Android.Telephony.Mbms.StreamingStateChangedReason,OutOfMemory,remove,
I,28,android/telephony/mbms/StreamingService.STATE_STALLED,3,,,,
I,28,android/telephony/mbms/StreamingService.STATE_STARTED,2,,,,
I,28,android/telephony/mbms/StreamingService.STATE_STOPPED,1,,,,
E,28,android/telephony/mbms/StreamingService.STATE_STALLED,3,Android.Telephony.StreamingState,Stalled,keep,
E,28,android/telephony/mbms/StreamingService.STATE_STARTED,2,Android.Telephony.StreamingState,Started,keep,
E,28,android/telephony/mbms/StreamingService.STATE_STOPPED,1,Android.Telephony.StreamingState,Stopped,keep,
E,28,android/telephony/mbms/StreamingService.UNICAST_METHOD,2,Android.Telephony.Mbms.StreamingMethod,Unicast,remove,
I,28,android/telephony/mbms/StreamingServiceCallback.SIGNAL_STRENGTH_UNAVAILABLE,-1,,,,
I,28,android/telephony/MbmsDownloadSession.RESULT_CANCELLED,2,,,,
@@ -13594,11 +13594,11 @@ I,28,android/telephony/MbmsDownloadSession.RESULT_IO_ERROR,4,,,,
I,28,android/telephony/MbmsDownloadSession.RESULT_OUT_OF_STORAGE,7,,,,
I,28,android/telephony/MbmsDownloadSession.RESULT_SERVICE_ID_NOT_DEFINED,5,,,,
I,28,android/telephony/MbmsDownloadSession.RESULT_SUCCESSFUL,1,,,,
I,28,android/telephony/MbmsDownloadSession.STATUS_ACTIVELY_DOWNLOADING,1,,,,
I,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_DOWNLOAD,2,,,,
I,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_DOWNLOAD_WINDOW,4,,,,
I,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_REPAIR,3,,,,
I,28,android/telephony/MbmsDownloadSession.STATUS_UNKNOWN,0,,,,
E,28,android/telephony/MbmsDownloadSession.STATUS_ACTIVELY_DOWNLOADING,1,Android.Telephony.Mbms.DownloadStatus,ActivelyDownloading,keep,
E,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_DOWNLOAD,2,Android.Telephony.Mbms.DownloadStatus,PendingDownload,keep,
E,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_DOWNLOAD_WINDOW,4,Android.Telephony.Mbms.DownloadStatus,PendingDownloadWindow,keep,
E,28,android/telephony/MbmsDownloadSession.STATUS_PENDING_REPAIR,3,Android.Telephony.Mbms.DownloadStatus,PendingRepair,keep,
E,28,android/telephony/MbmsDownloadSession.STATUS_UNKNOWN,0,Android.Telephony.Mbms.DownloadStatus,Unknown,keep,
I,0,android/telephony/NeighboringCellInfo.UNKNOWN_CID,-1,,,,
I,0,android/telephony/NeighboringCellInfo.UNKNOWN_RSSI,99,,,,
E,30,android/telephony/NetworkRegistrationInfo.DOMAIN_CS,1,Android.Telephony.NetworkRegistrationInfoDomain,Cs,remove,
6 changes: 5 additions & 1 deletion src/Mono.Android/metadata
Original file line number Diff line number Diff line change
@@ -1880,7 +1880,11 @@
<attr api-since="34" path="/api/package[@name='android.content']/class[@name='ContextWrapper']/method[@name='registerReceiver' and count(parameter)=5 and parameter[1][@type='android.content.BroadcastReceiver'] and parameter[2][@type='android.content.IntentFilter'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='android.os.Handler'] and parameter[5][@type='int']]" name="deprecated">This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.</attr>
<attr api-since="34" path="/api/package[@name='android.test.mock']/class[@name='MockContext']/method[@name='registerReceiver' and count(parameter)=3 and parameter[1][@type='android.content.BroadcastReceiver'] and parameter[2][@type='android.content.IntentFilter'] and parameter[3][@type='int']]" name="deprecated">This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.</attr>
<attr api-since="34" path="/api/package[@name='android.test.mock']/class[@name='MockContext']/method[@name='registerReceiver' and count(parameter)=5 and parameter[1][@type='android.content.BroadcastReceiver'] and parameter[2][@type='android.content.IntentFilter'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='android.os.Handler'] and parameter[5][@type='int']]" name="deprecated">This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.</attr>


<!-- These methods are hand-bound in HardwareBuffer.cs because they have a long enum type, which generator doesn't support. -->
<remove-node api-since="26" path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/method[@name='create' and count(parameter)=5 and parameter[1][@type='int'] and parameter[2][@type='int'] and parameter[3][@type='int'] and parameter[4][@type='int'] and parameter[5][@type='long']]" />
<remove-node api-since="26" path="/api/package[@name='android.hardware']/class[@name='HardwareBuffer']/method[@name='getUsage' and count(parameter)=0]" />

<!--
***********************************************************************
THE FOLLOWING LINES MUST BE CREATED FOR ANY NEW PLATFORM THAT IS ADDED.
18 changes: 6 additions & 12 deletions src/Mono.Android/methodmap.csv
Original file line number Diff line number Diff line change
@@ -1656,7 +1656,7 @@
21, android.net, NetworkRequest.Builder, addTransportType, transportType, Android.Net.TransportType
21, android.net, NetworkRequest.Builder, removeCapability, capability, Android.Net.NetCapability
21, android.net, NetworkRequest.Builder, removeTransportType, transportType, Android.Net.TransportType
21, android.net.wifi, WifiManager.WpsCallback, onFailed, reason, Android.Net.WpsFailureReason
21, android.net.wifi, WifiManager.WpsCallback, onFailed, reason, Android.Net.Wifi.WpsFailureReason
21, android.os, PowerManager.WakeLock, release, flags, Android.OS.WakeLockFlags
21, android.provider, ContactsContract.CommonDataKinds.Event, getTypeLabel, type, Android.Provider.EventDataKind
21, android.service.notification, NotificationListenerService, getCurrentInterruptionFilter, return, Android.Service.Notification.InterruptionFilterType
@@ -1991,9 +1991,6 @@
24, android.icu.text, Collator, setDecomposition, decomposition, Android.Icu.Text.CollatorDecompositionMode
24, android.icu.text, Collator, getStrength, return, Android.Icu.Text.CollationStrength
24, android.icu.text, Collator, setStrength, newStrength, Android.Icu.Text.CollationStrength
24, android.icu.text, Collator, getEquivalentReorderCodes, reorderCode, Android.Icu.Text.CollatorReorderCodes
24, android.icu.text, Collator, getReorderCodes, return, Android.Icu.Text.CollatorReorderCodes[]
24, android.icu.text, Collator, setReorderCodes, order, params Android.Icu.Text.CollatorReorderCodes[]
24, android.icu.text, DateFormat.Field, ofCalendarField, calendarField, Android.Icu.Util.CalendarField
24, android.icu.text, DateFormat, getDateInstance, dateStyle, Android.Icu.Text.DateFormatStyle
24, android.icu.text, DateFormat, getDateInstance, style, Android.Icu.Text.DateFormatStyle
@@ -2077,7 +2074,7 @@
24, android.nfc.cardemulation, HostNfcFService, onDeactivated, reason, Android.Nfc.CardEmulators.DeactivationReasonF

24, android.os, HardwarePropertiesManager, getDeviceTemperatures, type, Android.OS.DeviceTemperatureType
24, android.os, HardwarePropertiesManager, getDeviceTemperatures, source, Android.OS.DeviceTemperatureSource
24, android.os, HardwarePropertiesManager, getDeviceTemperatures, source, Android.OS.TemperatureSource
24, android.service.notification, Condition, flags, , Android.Service.Notification.ConditionFlags
24, android.service.notification, Condition, state, , Android.Service.Notification.ConditionState
24, android.service.notification, Condition, relevanceToString, flags, Android.Service.Notification.ConditionFlags
@@ -2392,8 +2389,8 @@
28, android.content.pm, PermissionInfo, getProtectionFlags, return, Android.Content.PM.Protection
28, android.content.pm, ShortcutInfo, getDisabledReason, return, Android.Content.PM.ShortcutDisabledReason
28, android.graphics.drawable, Icon, getType, return, Android.Graphics.Drawables.IconType
28, android.graphics, ImageDecoder, getAllocator, return, Android.Graphics.ImageDecoderAllocatorType
28, android.graphics, ImageDecoder, setAllocator, allocator, Android.Graphics.ImageDecoderAllocatorType
28, android.graphics, ImageDecoder, getAllocator, return, Android.Graphics.ImageDecoderAllocator
28, android.graphics, ImageDecoder, setAllocator, allocator, Android.Graphics.ImageDecoderAllocator
28, android.graphics, ImageDecoder, getMemorySizePolicy, return, Android.Graphics.ImageDecoderMemoryPolicy
28, android.graphics, ImageDecoder, setMemorySizePolicy, policy, Android.Graphics.ImageDecoderMemoryPolicy
28, android.graphics, ImageDecoder.DecodeException, getError, return, Android.Graphics.ImageDecoderErrorType
@@ -2432,9 +2429,9 @@
28, android.telephony.data, ApnSetting.Builder, setProtocol, protocol, Android.Telephony.Data.Protocols
28, android.telephony.data, ApnSetting.Builder, setRoamingProtocol, roamingProtocol, Android.Telephony.Data.Protocols
28, android.telephony, Call.Callback, onHandoverFailed, failureReason, Android.Telephony.HandoverFailureReason
28, android.telephony.mbms, StreamingServiceCallback, onStreamMethodUpdated, methodType, Android.Telephony.StreamingMethod
28, android.telephony.mbms, StreamingServiceCallback, onStreamMethodUpdated, methodType, Android.Telephony.Mbms.StreamingMethod
28, android.telephony.mbms, StreamingServiceCallback, onStreamStateUpdated, state, Android.Telephony.StreamingState
28, android.telephony.mbms, StreamingServiceCallback, onStreamStateUpdated, reason, Android.Telephony.StreamingStateChangedReason
28, android.telephony.mbms, StreamingServiceCallback, onStreamStateUpdated, reason, Android.Telephony.Mbms.StreamingStateChangedReason
28, android.telephony.mbms, DownloadStatusListener, onStatusUpdated, status, Android.Telephony.Mbms.DownloadStatus
28, android.telephony, TelephonyScanManager.NetworkScanCallback, onError, error, Android.Telephony.ScanResultCode
28, android.telephony, NetworkScanRequest, ctor, scanType, Android.Telephony.NetworkScanType
@@ -2500,7 +2497,6 @@
29, android.app, Service, startForeground, foregroundServiceType, Android.Content.PM.ForegroundService
// Cannot change this at this state.
// 27, android.app, WallpaperManager.OnColorsChangedListener, onColorsChanged, which, Android.App.WallpaperManagerFlags
29, android.content, Context, bindIsolatedService, flags, Android.App.Bind
29, android.content.pm, PackageInstaller.SessionInfo, getStagedSessionErrorCode, return, Android.Content.PM.StagedSession
29, android.content.pm, PackageInstaller, installExistingPackage, installReason, Android.Content.PM.InstallReason
// Cannot change this at this state.
@@ -2525,7 +2521,6 @@
29, android.hardware.camera2.params, RecommendedStreamConfigurationMap, getValidOutputFormatsForInput, inputFormat, Android.Graphics.ImageFormatType
29, android.hardware.camera2.params, RecommendedStreamConfigurationMap, getRecommendedUseCase, return, Android.Hardware.Camera2.Params.UsecaseMode
29, android.hardware, HardwareBuffer, isSupported, format, Android.Hardware.HardwareBufferFormat
29, android.hardware, HardwareBuffer, isSupported, usage, Android.Hardware.HardwareBufferUsage
// Cannot change this at this state.
// 24, android.icu.lang, UScript, getScript, return, Android.Icu.Lang.UScriptCode
29, android.icu.text, Bidi, writeReverse, options, Android.Icu.Text.BidiOptions
@@ -2674,7 +2669,6 @@
30,android/app,NotificationManager$Policy,ctor,suppressedVisualEffects,Android.App.SuppressedEffects
30,android/app,SyncNotedAppOp,writeToParcel,flags,Android.OS.ParcelableWriteFlags
30,android/content,ContentResolver,notifyChange,flags,Android.Content.NotifyChangeFlags
30,android/content,Context,bindServiceAsUser,flags,Android.Content.Bind
30,android/content,Context,createWindowContext,type,Android.Views.WindowManagerTypes
30,android/content,Context,sendOrderedBroadcast,initialCode,Android.App.Result
30,android/content,ContextWrapper,sendOrderedBroadcast,initialCode,Android.App.Result
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Compat issues with assembly Mono.Android:
CannotAddAbstractMembers : Member 'public void Android.Net.Wifi.WifiManager.WpsCallback.OnFailed(Android.Net.Wifi.WpsFailureReason)' is abstract in the implementation but is missing in the contract.

0 comments on commit c20d51f

Please sign in to comment.