| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 | 11 |
| 12 #import <AVFoundation/AVFoundation.h> | |
| 13 #import <Foundation/Foundation.h> | 12 #import <Foundation/Foundation.h> |
| 14 #import <sys/sysctl.h> | 13 #import <sys/sysctl.h> |
| 15 #if defined(WEBRTC_IOS) | 14 #if defined(WEBRTC_IOS) |
| 16 #import <UIKit/UIKit.h> | 15 #import <UIKit/UIKit.h> |
| 17 #endif | 16 #endif |
| 18 | 17 |
| 19 #include <memory> | 18 #include <memory> |
| 20 | 19 |
| 21 #include "webrtc/base/checks.h" | 20 #include "webrtc/base/checks.h" |
| 22 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
| 23 #include "webrtc/sdk/objc/Framework/Classes/helpers.h" | 22 #include "webrtc/sdk/objc/Framework/Classes/Common/helpers.h" |
| 24 | 23 |
| 25 namespace webrtc { | 24 namespace webrtc { |
| 26 namespace ios { | 25 namespace ios { |
| 27 | 26 |
| 28 #if defined(WEBRTC_IOS) | 27 #if defined(WEBRTC_IOS) |
| 29 bool isOperatingSystemAtLeastVersion(double version) { | 28 bool isOperatingSystemAtLeastVersion(double version) { |
| 30 return GetSystemVersion() >= version; | 29 return GetSystemVersion() >= version; |
| 31 } | 30 } |
| 32 #endif | 31 #endif |
| 33 | 32 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 58 } | 57 } |
| 59 | 58 |
| 60 // TODO(henrika): see if it is possible to move to GetThreadName in | 59 // TODO(henrika): see if it is possible to move to GetThreadName in |
| 61 // platform_thread.h and base it on pthread methods instead. | 60 // platform_thread.h and base it on pthread methods instead. |
| 62 std::string GetCurrentThreadDescription() { | 61 std::string GetCurrentThreadDescription() { |
| 63 NSString* name = [NSString stringWithFormat:@"%@", [NSThread currentThread]]; | 62 NSString* name = [NSString stringWithFormat:@"%@", [NSThread currentThread]]; |
| 64 return StdStringFromNSString(name); | 63 return StdStringFromNSString(name); |
| 65 } | 64 } |
| 66 | 65 |
| 67 #if defined(WEBRTC_IOS) | 66 #if defined(WEBRTC_IOS) |
| 68 std::string GetAudioSessionCategory() { | |
| 69 NSString* category = [[AVAudioSession sharedInstance] category]; | |
| 70 return StdStringFromNSString(category); | |
| 71 } | |
| 72 | |
| 73 std::string GetSystemName() { | 67 std::string GetSystemName() { |
| 74 NSString* osName = [[UIDevice currentDevice] systemName]; | 68 NSString* osName = [[UIDevice currentDevice] systemName]; |
| 75 return StdStringFromNSString(osName); | 69 return StdStringFromNSString(osName); |
| 76 } | 70 } |
| 77 | 71 |
| 78 std::string GetSystemVersionAsString() { | 72 std::string GetSystemVersionAsString() { |
| 79 NSString* osVersion = [[UIDevice currentDevice] systemVersion]; | 73 NSString* osVersion = [[UIDevice currentDevice] systemVersion]; |
| 80 return StdStringFromNSString(osVersion); | 74 return StdStringFromNSString(osVersion); |
| 81 } | 75 } |
| 82 | 76 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 } | 126 } |
| 133 LOG(LS_WARNING) << "webrtc::ios::GetLowPowerModeEnabled() is not " | 127 LOG(LS_WARNING) << "webrtc::ios::GetLowPowerModeEnabled() is not " |
| 134 "supported. Requires at least iOS 9.0"; | 128 "supported. Requires at least iOS 9.0"; |
| 135 return false; | 129 return false; |
| 136 } | 130 } |
| 137 #endif | 131 #endif |
| 138 | 132 |
| 139 } // namespace ios | 133 } // namespace ios |
| 140 } // namespace webrtc | 134 } // namespace webrtc |
| 141 | 135 |
| OLD | NEW |