BKSProcessAssertion.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. typedef NS_ENUM(NSUInteger, BKSProcessAssertionReason)
  2. {
  3. BKSProcessAssertionReasonNone = 0,
  4. BKSProcessAssertionReasonAudio = 1,
  5. BKSProcessAssertionReasonLocation = 2,
  6. BKSProcessAssertionReasonExternalAccessory = 3,
  7. BKSProcessAssertionReasonFinishTask = 4,
  8. BKSProcessAssertionReasonBluetooth = 5,
  9. BKSProcessAssertionReasonNetworkAuthentication = 6,
  10. BKSProcessAssertionReasonBackgroundUI = 7,
  11. BKSProcessAssertionReasonInterAppAudioStreaming = 8,
  12. BKSProcessAssertionReasonViewServices = 9,
  13. BKSProcessAssertionReasonNewsstandDownload = 10,
  14. BKSProcessAssertionReasonBackgroundDownload = 11,
  15. BKSProcessAssertionReasonVOiP = 12,
  16. BKSProcessAssertionReasonExtension = 13,
  17. BKSProcessAssertionReasonContinuityStreams = 14,
  18. // 15-9999 unknown
  19. BKSProcessAssertionReasonActivation = 10000,
  20. BKSProcessAssertionReasonSuspend = 10001,
  21. BKSProcessAssertionReasonTransientWakeup = 10002,
  22. BKSProcessAssertionReasonVOiP_PreiOS8 = 10003,
  23. BKSProcessAssertionReasonPeriodicTask_iOS8 = BKSProcessAssertionReasonVOiP_PreiOS8,
  24. BKSProcessAssertionReasonFinishTaskUnbounded = 10004,
  25. BKSProcessAssertionReasonContinuous = 10005,
  26. BKSProcessAssertionReasonBackgroundContentFetching = 10006,
  27. BKSProcessAssertionReasonNotificationAction = 10007,
  28. // 10008-49999 unknown
  29. BKSProcessAssertionReasonFinishTaskAfterBackgroundContentFetching = 50000,
  30. BKSProcessAssertionReasonFinishTaskAfterBackgroundDownload = 50001,
  31. BKSProcessAssertionReasonFinishTaskAfterPeriodicTask = 50002,
  32. BKSProcessAssertionReasonAFterNoficationAction = 50003,
  33. // 50004+ unknown
  34. };
  35. typedef NS_ENUM(NSUInteger, ProcessAssertionFlags)
  36. {
  37. BKSProcessAssertionFlagNone = 0,
  38. BKSProcessAssertionFlagPreventSuspend = 1 << 0,
  39. BKSProcessAssertionFlagPreventThrottleDownCPU = 1 << 1,
  40. BKSProcessAssertionFlagAllowIdleSleep = 1 << 2,
  41. BKSProcessAssertionFlagWantsForegroundResourcePriority = 1 << 3
  42. };
  43. @interface BKSProcessAssertion : NSObject
  44. - (instancetype)initWithPID:(NSInteger)pid flags:(NSUInteger)flags reason:(NSUInteger)reason name:(NSString *)name withHandler:(id)handler;
  45. + (NSString *)NameForReason:(NSUInteger)reason;
  46. - (BOOL)valid;
  47. @end