7#include <AvailabilityMacros.h>
8#include <Foundation/Foundation.h>
9#include <Foundation/NSProcessInfo.h>
22 const NSActivityOptions activityOptions =
23 NSActivityUserInitiatedAllowingIdleSystemSleep &
24 ~(NSActivitySuddenTerminationDisabled |
25 NSActivityAutomaticTerminationDisabled);
27 id processInfo = [NSProcessInfo processInfo];
28 if ([processInfo respondsToSelector:
@selector
29 (beginActivityWithOptions:reason:)]) {
31 beginActivityWithOptions:activityOptions
32 reason:
@"Temporarily disable App Nap "
43 id processInfo = [NSProcessInfo processInfo];
44 if ([processInfo respondsToSelector:
@selector(endActivity:)]) {
63 impl->disableAppNap();
std::unique_ptr< CAppNapImpl > impl