Skip to content
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

Add PostNotifications to Permissions #19472

Merged
merged 5 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class PermissionsViewModel : BaseViewModel
new PermissionItem("Phone", new Permissions.Phone()),
new PermissionItem("Photos", new Permissions.Photos()),
new PermissionItem("Photos AddOnly", new Permissions.PhotosAddOnly()),
new PermissionItem("Post Notification", new Permissions.PostNotifications()),
new PermissionItem("Reminders", new Permissions.Reminders()),
new PermissionItem("Sensors", new Permissions.Sensors()),
new PermissionItem("SMS", new Permissions.Sms()),
Expand Down
22 changes: 22 additions & 0 deletions src/Essentials/src/Permissions/Permissions.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,28 @@ public partial class PhotosAddOnly : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
public override (string androidPermission, bool isRuntime)[] RequiredPermissions
{
get
{
var permissions = new List<(string, bool)>();

#if __ANDROID_33__
if (OperatingSystem.IsAndroidVersionAtLeast(33) && Application.Context.ApplicationInfo.TargetSdkVersion >= BuildVersionCodes.Tiramisu)
{
// new runtime permissions on Android 12
if (IsDeclaredInManifest(Manifest.Permission.PostNotifications))
permissions.Add((Manifest.Permission.PostNotifications, true));
}
#endif

return permissions.ToArray();
}
}
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ public partial class PhotosAddOnly : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
4 changes: 4 additions & 0 deletions src/Essentials/src/Permissions/Permissions.macos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ public partial class PhotosAddOnly : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
4 changes: 4 additions & 0 deletions src/Essentials/src/Permissions/Permissions.netstandard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public partial class PhotosAddOnly : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
8 changes: 8 additions & 0 deletions src/Essentials/src/Permissions/Permissions.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,14 @@ public partial class PhotosAddOnly : BasePlatformPermission
{
}

/// <summary>
/// Represents permission to post notifications
/// </summary>
public partial class PostNotifications
{
}


/// <summary>
/// Represents permission to access the device reminders data.
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Essentials/src/Permissions/Permissions.tizen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ public partial class Photos : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
4 changes: 4 additions & 0 deletions src/Essentials/src/Permissions/Permissions.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ public partial class Photos : BasePlatformPermission
{
}

public partial class PostNotifications : BasePlatformPermission
{
}

public partial class Reminders : BasePlatformPermission
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
~override Microsoft.Maui.ApplicationModel.Permissions.NearbyWifiDevices.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.NetworkState.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.Phone.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.Sensors.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.Sms.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
~override Microsoft.Maui.ApplicationModel.Permissions.Speech.RequiredPermissions.get -> (string androidPermission, bool isRuntime)[]
Expand Down Expand Up @@ -434,6 +435,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Phone.Phone() -> void
Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Expand Down
2 changes: 2 additions & 0 deletions src/Essentials/src/PublicAPI/net-ios/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
2 changes: 2 additions & 0 deletions src/Essentials/src/PublicAPI/net/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ Microsoft.Maui.ApplicationModel.Permissions.Photos
Microsoft.Maui.ApplicationModel.Permissions.Photos.Photos() -> void
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly
Microsoft.Maui.ApplicationModel.Permissions.PhotosAddOnly.PhotosAddOnly() -> void
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications
Microsoft.Maui.ApplicationModel.Permissions.PostNotifications.PostNotifications() -> void
Microsoft.Maui.ApplicationModel.Permissions.Reminders
Microsoft.Maui.ApplicationModel.Permissions.Reminders.Reminders() -> void
Microsoft.Maui.ApplicationModel.Permissions.Sensors
Expand Down
Loading