Skip to content

Commit c14d9f4

Browse files
CopilotPureWeen
andcommitted
[Android] Fix OnIdiom threading issue by removing using statements in DeviceInfo (#30288)
* Initial plan * Fix OnIdiom threading issue by removing using statements in DeviceInfo.android.cs Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
1 parent 4bfd8d7 commit c14d9f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Essentials/src/DeviceInfo/DeviceInfo.android.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public DeviceIdiom Idiom
4141
var currentIdiom = DeviceIdiom.Unknown;
4242

4343
// first try UIModeManager
44-
using var uiModeManager = UiModeManager.FromContext(Application.Context);
44+
var uiModeManager = UiModeManager.FromContext(Application.Context);
4545

4646
try
4747
{
@@ -66,7 +66,7 @@ public DeviceIdiom Idiom
6666
else
6767
{
6868
// start clutching at straws
69-
using var metrics = Application.Context.Resources?.DisplayMetrics;
69+
var metrics = Application.Context.Resources?.DisplayMetrics;
7070
if (metrics != null)
7171
{
7272
var minSize = Math.Min(metrics.WidthPixels, metrics.HeightPixels);

0 commit comments

Comments
 (0)