2 using System
.Threading
;
3 using System
.Runtime
.InteropServices
;
4 using System
.Collections
.Generic
;
8 namespace Android
.Runtime
{
9 public static class AndroidEnvironment
{
11 public const string AndroidLogAppName
= "Mono.Android";
13 static object lock_
= new object ();
16 // System.Core!System.AndroidPlatform.GetDefaultTimeZone ()
18 static string GetDefaultTimeZone ()
20 return "America/Los_Angeles"; //add glue code if you really care
24 // mscorlib.dll!System.AndroidPlatform.GetDefaultSyncContext()
26 static SynchronizationContext
GetDefaultSyncContext ()
28 return null; //we don't really care
31 // These are invoked by
32 // System.dll!System.AndroidPlatform.getifaddrs
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
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;
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
)
74 static IWebProxy
GetDefaultProxy ()