Ver código fonte

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

huangxiaodong 1 ano atrás
pai
commit
7252f8b10d

+ 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];
     }