[sdks] Source drop from xamarin/mono-sdks (#5876)
[mono-project.git] / sdks / android / managed / fake-monodroid.cs
blobb168b2146364c547b9da4c384978bc1b53072927
1 using System;
2 using System.Threading;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Net;
8 namespace Android.Runtime {
9 public static class AndroidEnvironment {
11 public const string AndroidLogAppName = "Mono.Android";
13 static object lock_ = new object ();
15 // This is invoked by
16 // System.Core!System.AndroidPlatform.GetDefaultTimeZone ()
17 // DO NOT REMOVE
18 static string GetDefaultTimeZone ()
20 return "America/Los_Angeles"; //add glue code if you really care
23 // This is invoked by
24 // mscorlib.dll!System.AndroidPlatform.GetDefaultSyncContext()
25 // DO NOT REMOVE
26 static SynchronizationContext GetDefaultSyncContext ()
28 return null; //we don't really care
31 // These are invoked by
32 // System.dll!System.AndroidPlatform.getifaddrs
33 // DO NOT REMOVE
34 [DllImport ("__Internal")]
35 static extern int monodroid_getifaddrs (out IntPtr ifap);
37 static int GetInterfaceAddresses (out IntPtr ifap)
39 return monodroid_getifaddrs (out ifap);
42 // These are invoked by
43 // System.dll!System.AndroidPlatform.freeifaddrs
44 // DO NOT REMOVE
45 [DllImport ("__Internal")]
46 static extern void monodroid_freeifaddrs (IntPtr ifap);
48 static void FreeInterfaceAddresses (IntPtr ifap)
50 monodroid_freeifaddrs (ifap);
53 [DllImport ("__Internal")]
54 static extern void _monodroid_detect_cpu_and_architecture (ref ushort built_for_cpu, ref ushort running_on_cpu, ref byte is64bit);
56 static void DetectCPUAndArchitecture (out ushort builtForCPU, out ushort runningOnCPU, out bool is64bit)
58 ushort built_for_cpu = 0;
59 ushort running_on_cpu = 0;
60 byte _is64bit = 0;
62 _monodroid_detect_cpu_and_architecture (ref built_for_cpu, ref running_on_cpu, ref _is64bit);
63 builtForCPU = built_for_cpu;
64 runningOnCPU = running_on_cpu;
65 is64bit = _is64bit != 0;
69 static bool TrustEvaluateSsl (List <byte[]> certsRawData)
71 return true;
74 static IWebProxy GetDefaultProxy ()
76 return null;