소스 검색

1.下载单个文件wifi切换4G 下载没有暂停

huangxiaodong 1 년 전
부모
커밋
7252f8b10d
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 13 0
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+downloadFile.m

+ 13 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+downloadFile.m

@@ -107,6 +107,19 @@
             return;
         }
         
+        BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular)];
+        if(!isCanUseCellular){//不允许流量上传
+            //
+            if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN){
+                [[downloadManager shareInstance] suspendDownloadFileFun:YES];
+                mainBlock(^{
+                    [[NSNotificationCenter defaultCenter] postNotificationName:downloadFileSuspendAllNotification object:nil];
+                    [[iToast makeText:NSLocalizedString(@"File_Transfer_By_Cellular_tip",nil)] show];
+                });
+                return;
+            }
+        }
+        
         NSString * commandStr = [RCCommandHelp applyForDownloadFileBy:self.downloadFileTaskUid withFilePath:self.curDownloadFileModel.path withPosition:didDownloadBytes];
         [self.commandChannelManager rc_sendData:commandStr];
     }