Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: webrtc/modules/utility/source/helpers_ios.mm

Issue 1739893003: Fix lowPowerModeEnabled crash on iOS8 (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/utility/source/helpers_ios.mm
diff --git a/webrtc/modules/utility/source/helpers_ios.mm b/webrtc/modules/utility/source/helpers_ios.mm
index 4b28cee3dc97e0f3afd132d95f121d35b6d27a32..a312f032d13f6bd8460f04b8df904ef1a42dc316 100644
--- a/webrtc/modules/utility/source/helpers_ios.mm
+++ b/webrtc/modules/utility/source/helpers_ios.mm
@@ -170,7 +170,12 @@ int GetProcessorCount() {
}
bool GetLowPowerModeEnabled() {
- return [NSProcessInfo processInfo].lowPowerModeEnabled;
+ NSProcessInfo* info = [NSProcessInfo processInfo];
+ // lowPoweredModeEnabled is only available on iOS9+.
+ if ([info respondsToSelector:@selector(lowPoweredModeEnabled)]) {
henrika_webrtc 2016/02/26 08:24:24 Just learning. Is this the way to go to check for
+ return info.lowPowerModeEnabled;
+ }
+ return false;
}
} // namespace ios
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698