-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[Android][libraries] TimeZoneInfo Android imp #54845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
82 commits
Select commit
Hold shift + click to select a range
1014cc6
Initial Android implementation
d161105
Split implementations for Android specific GetTimeZoneIds
cfa0b33
Differentiate Unix and Android TimeZoneInfo by PopulateAllSystemTimeZ…
caa39a6
Utilize Android paths for timezone data
ee51c67
Clean up mono style to match runtime style
ce91611
Pulled in parsing implementation from mono and broke out GetLocalTime…
4ed8616
TimeZoneInfo.Android builds properly now. Found PopulateAllSystemTim…
555d0b5
Found TryGetTimeZoneFromLocalMachine to map to FindSystemTimeZoneById…
d59fb1a
Fixed typo on type
84dcbb7
Added cacheddata param
cb9efd4
Initial implementation of PopulateAllSystemTimeZonesCore and TryGetTi…
b68e290
Clean up missing variables and wrong function calls
65615ca
Fix cachedData parameter overload
514fa44
Add JNI GetDefaultTimeZone
6c3e567
Remove excess of imports in pal_datetime
3787086
Clean up PopulateAllSystemTimeZonesCore comments
912ab4d
Remove ParseTZBuffer middleman
d67920e
Add id check and runtime style to _GetTimeZone
b602bf7
cleanup pal_datetime imports
caa9229
Remove ZoneTab related code
a7aee33
Remove Version related code
fb72a04
Remove PopulateAllSystemTimeZonesCore middleman
c3f1e18
Add return for non Android
c314363
Avoid using static constructor for paths
0890a23
Remove redundant using
80c28e8
Fix GetTimeZoneIds return
858ef84
Condition TargetsAndroid around function
e062265
Clean up functions
3956ff7
Remove GetTimeZoneDirectory Android implementation
18c4955
Remove interface
37c0a0c
Cleanup style
98ee19d
Remove zoneTabOffset
fc8ce4a
Temporarily add GetTimeZoneDirectory
c4397b7
Refactoring code
7188c6b
Address some feedback
3198101
Move interop to its own file
1a495cc
Rename variable
6e40f61
Refactor to modify access from internal to private
4c82a11
Remove static Paths, pass tzFilePath as parameter instead of holding
3cc1da1
Add ordinal comparison for performance gain
4df973a
Add Softcode Local
b4d5ba6
Softcode tzdata file path
2bb25ce
Refactor Unix specific code
efa339e
Lazy allocation of Android TimeZone Data
54e3218
Fix up imports
144f4dd
Apply coding style
0790650
More clean up
5f4fae7
Rename property
d1070d1
Update TimeZone data header and entry structs
e20c6cb
Refactor header correctness check
4b31684
Fix resource string message
2616ca0
Revert to original header check
ecf6f70
Cleanup comments
3b424dc
Expect Ansi strings
ed3355e
Fix casing
2bfb9e4
Stackalloc tzdata buffer
5edd7ea
Remove redundant exception message
966aee5
Remove nullable from fields
290caa2
Add missing namechange
fc551d2
Pass stream through ReadHeader and only open file once
6fb3133
Rename files
6ccad5d
Avoid unnecessary allocation
0987ee7
Assert buffer size over creating resource exception
69d5a84
Merge remote-tracking branch 'upstream/main' into port_android_timezo…
8d88a6d
Use compare exchange atomic method
4433be6
Reduce redundant calls
8330c2a
Cleanup output variables
b8bcce4
Remove comments
37b80ca
Use sizeof over Marshal
8891709
Address feedback
15d4455
Address Feedback
6501d7e
Address more feedback
a63f8f9
Separate buffer loading into independent method
16289d2
Properly set where to write into the buffer
d5ffcef
Update comments
311ecaa
Remove AndroidTzDataHeader and fix typos
a07da96
Add const keyword, move field declaration, use length comparison
a47ade2
Change data entry id to string
cc06d96
Parse id account for null terminating character
00b0abe
Remove AndroidTzDataEntry struct and use out parameters
5290490
Remove unsafe keywords
95f30f6
Close file handle in GetTimeZoneData
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDefaultTimeZone.Android.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal static partial class Interop | ||
{ | ||
internal static partial class Sys | ||
{ | ||
[DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetDefaultTimeZone", CharSet = CharSet.Ansi, SetLastError = true)] | ||
internal static extern string? GetDefaultTimeZone(); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.