|
|
@@ -10,6 +10,7 @@
|
|
|
#import "RcGameWQKeyChain.h"
|
|
|
#import "errorAlertTool.h"
|
|
|
#import "webRtcManager+downloadNasFile.h"
|
|
|
+#import "nasMixUploadManager.h"
|
|
|
|
|
|
@interface webRtcManager ()<MediaStreamClientEventsDelegate>
|
|
|
{
|
|
|
@@ -49,6 +50,8 @@
|
|
|
#pragma mark 十秒一次的timer检测
|
|
|
- (void)timerChange{
|
|
|
[self checkChannelLinkStateFun];
|
|
|
+
|
|
|
+ [self checkAllTaskFun];
|
|
|
}
|
|
|
|
|
|
#pragma mark 检测链接是否OK
|
|
|
@@ -605,6 +608,46 @@
|
|
|
[[iTools getKeyWindow] addSubview:self->curUSBInsertPopV];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 检测nas任务情况
|
|
|
+- (void)checkAllTaskFun
|
|
|
+{
|
|
|
+ HLog(@"checkAllTaskFun");
|
|
|
+ //处理相册备份
|
|
|
+ [[nasBackupsManager shareInstance] checkReBackupsFileFun];
|
|
|
+
|
|
|
+ //[[uploadFileManager shareInstance] checkReUploadFileFun];
|
|
|
+ //[[downloadManager shareInstance] checkReDownloadFileFun];
|
|
|
+
|
|
|
+ if([AudioSessionObject shareManager].isBackgroundType){
|
|
|
+ [self checkFileTransfeTaskFun];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 检测是否正在进行的文件传输任务 设置后台状态
|
|
|
+- (void)checkFileTransfeTaskFun
|
|
|
+{
|
|
|
+
|
|
|
+ BOOL isBackupsingType = [[nasBackupsManager shareInstance] checkBackupsingFun];
|
|
|
+ BOOL isUploadingType = [[nasMixUploadManager shareManager] checkUploadTaskDoingFun];
|
|
|
+ BOOL isDownloadingType = [[nasDownloadManager shareManager] isDownLoadIngType];
|
|
|
+ BOOL isNasDownloadingType = [customDownloadManager shareManager].isDownLoadIngType;
|
|
|
+
|
|
|
+ BOOL isBackground = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_working_background)];
|
|
|
+
|
|
|
+ if ((isBackupsingType || isUploadingType || isDownloadingType ||isNasDownloadingType) && isBackground) {
|
|
|
+ HLog(@"后台保活中");
|
|
|
+ [cachesFileManager writeLogsWithMsg:@"Background working"];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ HLog(@"停止后台保活");
|
|
|
+ [cachesFileManager writeLogsWithMsg:@"stop Background working"];
|
|
|
+ [[AudioSessionObject shareManager] stopBackgroundActiveFun];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
#pragma mark 收到的webrtc消息处理
|
|
|
- (void)handleWebRtcMsgResponseBy:(NSData*)message
|