Skip to content

Commit

Permalink
NSActivityOptions.IdleDisplaySleepDisabled had wrong value (xamarin#2232
Browse files Browse the repository at this point in the history
)

This was due to an integer overflow.  The original value was based on Int32
1 << 40 == 256

The correct value should be based on a UInt64.
1UL << 40 == 1099511627776
  • Loading branch information
nberardi authored and dalexsoto committed Jun 21, 2017
1 parent 367da32 commit 8e959b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Foundation/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,13 @@ public enum NSUrlErrorCancelledReason : nint {

[Flags]
public enum NSActivityOptions : ulong {
IdleDisplaySleepDisabled = 1 << 40,
IdleSystemSleepDisabled = 1 << 20,
SuddenTerminationDisabled = 1 << 14,
AutomaticTerminationDisabled = 1 << 15,
UserInitiated = 0x00FFFFFF | IdleSystemSleepDisabled,
Background = 0x000000ff,
LatencyCritical = 0xFF00000000,
IdleDisplaySleepDisabled = 1UL << 40,
IdleSystemSleepDisabled = 1UL << 20,
SuddenTerminationDisabled = 1UL << 14,
AutomaticTerminationDisabled = 1UL << 15,
UserInitiated = 0x00FFFFFFUL | IdleSystemSleepDisabled,
Background = 0x000000ffUL,
LatencyCritical = 0xFF00000000UL,
}

[Native]
Expand Down

0 comments on commit 8e959b9

Please sign in to comment.