7#include <AvailabilityMacros.h>
8#include <Foundation/NSProcessInfo.h>
9#include <Foundation/Foundation.h>
25 const NSActivityOptions activityOptions =
26 NSActivityUserInitiatedAllowingIdleSystemSleep &
27 ~(NSActivitySuddenTerminationDisabled |
28 NSActivityAutomaticTerminationDisabled);
30 id processInfo = [NSProcessInfo processInfo];
31 if ([processInfo respondsToSelector:
@selector(beginActivityWithOptions:reason:)])
33 activityId = [processInfo beginActivityWithOptions: activityOptions reason:
@"Temporarily disable App Nap for bitcoin-qt."];
45 id processInfo = [NSProcessInfo processInfo];
46 if ([processInfo respondsToSelector:
@selector(endActivity:)])
65 impl->disableAppNap();
std::unique_ptr< CAppNapImpl > impl