Imported Upstream version 5.10.0.175

Former-commit-id: 1e840d201fb1f6fbd7457792e41c05a22ccd4e4f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-03-14 09:01:38 +00:00
parent e846c34f82
commit 65c63c2057
166 changed files with 629 additions and 44 deletions

View File

@@ -28,6 +28,7 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Mono {
@@ -79,5 +80,29 @@ namespace Mono {
// No longer used
return true;
}
#if !MOBILE
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void DisableMicrosoftTelemetry (IntPtr appBundleID, IntPtr appSignature, IntPtr appVersion, IntPtr merpGUIPath);
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern void EnableMicrosoftTelemetry_internal (IntPtr appBundleID, IntPtr appSignature, IntPtr appVersion, IntPtr merpGUIPath);
static void EnableMicrosoftTelemetry (string appBundleID_str, string appSignature_str, string appVersion_str, string merpGUIPath_str)
{
if (RuntimeInformation.IsOSPlatform (OSPlatform.OSX)) {
using (var appBundleID_chars = RuntimeMarshal.MarshalString (appBundleID_str))
using (var appSignature_chars = RuntimeMarshal.MarshalString (appSignature_str))
using (var appVersion_chars = RuntimeMarshal.MarshalString (appVersion_str))
using (var merpGUIPath_chars = RuntimeMarshal.MarshalString (merpGUIPath_str))
{
EnableMicrosoftTelemetry_internal (appBundleID_chars.Value, appSignature_chars.Value, appVersion_chars.Value, merpGUIPath_chars.Value);
}
} else {
throw new PlatformNotSupportedException("Merp support is currently only supported on OSX.");
}
}
#endif
}
}