Skip to content

Commit

Permalink
Merge pull request #1 from rookiejava/patch-2
Browse files Browse the repository at this point in the history
Update Permissions.cs
  • Loading branch information
OmidID authored Jul 12, 2023
2 parents d3cb937 + a8513ca commit 3c3cf3e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Tizen/Avalonia.Tizen/Platform/Permissions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public static void EnsureDeclared(params Privilege[] requiredPrivileges)
public static Task<bool> RequestPrivilegeAsync(params Privilege[] requiredPrivileges) => CheckPrivilegeAsync(requiredPrivileges, true);
private static async Task<bool> CheckPrivilegeAsync(Privilege[] requiredPrivileges, bool ask)
{
var ret = global::Tizen.System.Information.TryGetValue("http://tizen.org/feature/profile", out string profile);
if (!ret || (ret && (!profile.Equals("mobile") || !profile.Equals("wearable"))))
{
return true;
}

if (requiredPrivileges == null || !requiredPrivileges.Any())
return true;

Expand Down

0 comments on commit 3c3cf3e

Please sign in to comment.