Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Tizen] Fixed getting the device type #12133

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion Xamarin.Forms.Platform.Tizen/Forms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,27 @@ public static class Forms

static Lazy<string> s_deviceType = new Lazy<string>(() =>
{
TSystemInfo.TryGetValue("http://tizen.org/system/device_type", out string deviceType);
if (!TSystemInfo.TryGetValue("http://tizen.org/system/device_type", out string deviceType))
{
// Since, above key("http://tizen.org/system/device_type") is not available on Tizen 4.0, we uses profile to decide the type of device on 4.0.
var profile = GetProfile();
if (profile == "mobile")
{
deviceType = "Mobile";
}
else if (profile == "tv")
{
deviceType = "TV";
}
else if (profile == "wearable")
{
deviceType = "Wearable";
}
else
{
deviceType = "Unknown";
}
}
return deviceType;
});

Expand Down