Pārlūkot izejas kodu

1.根据是否开启流量来限制备份

huangxiaodong 1 gadu atpakaļ
vecāks
revīzija
c606c03a3e
25 mainītis faili ar 253 papildinājumiem un 24 dzēšanām
  1. 8 0
      创维盒子/双子星云手机.xcodeproj/project.pbxproj
  2. 7 0
      创维盒子/双子星云手机/AppDelegate/Config/Const.h
  3. 5 0
      创维盒子/双子星云手机/AppDelegate/Config/Const.m
  4. 5 0
      创维盒子/双子星云手机/AppDelegate/Config/Notification.h
  5. 5 4
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.m
  6. 1 0
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransfeSetViewController.m
  7. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.h
  8. 36 5
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.m
  9. 2 1
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/filePathCreatPopView.h
  10. 18 4
      创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/filePathCreatPopView.m
  11. 7 1
      创维盒子/双子星云手机/Class/Set/uploadFile/model/photosBackupsTaskModel.h
  12. 1 1
      创维盒子/双子星云手机/Class/Set/uploadFile/photoView/backupsFilerecordTableView.m
  13. 3 0
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.h
  14. 45 2
      创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.m
  15. 18 0
      创维盒子/双子星云手机/CloudPlayer/Model/couldPhoneCommonModel.h
  16. 12 0
      创维盒子/双子星云手机/CloudPlayer/Model/couldPhoneCommonModel.m
  17. 1 1
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+backupsFile.h
  18. 16 2
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+backupsFile.m
  19. 4 0
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.h
  20. 19 0
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm
  21. 1 0
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController.h
  22. 8 1
      创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm
  23. 9 1
      创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.h
  24. 18 0
      创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.m
  25. 3 0
      创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

+ 8 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -208,6 +208,8 @@
 		6B5B60772B3E665E009A2AE2 /* filePathCreatPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B60752B3E665E009A2AE2 /* filePathCreatPopView.m */; };
 		6B5B607A2B3E71B6009A2AE2 /* filePathCreatTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B60782B3E71B6009A2AE2 /* filePathCreatTableViewCell.h */; };
 		6B5B607B2B3E71B6009A2AE2 /* filePathCreatTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B60792B3E71B6009A2AE2 /* filePathCreatTableViewCell.m */; };
+		6B5D40152B47F27A000965CF /* couldPhoneCommonModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */; };
+		6B5D40162B47F27A000965CF /* couldPhoneCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */; };
 		6B72724B2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */; };
 		6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */; };
 		6B72724F2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */; };
@@ -617,6 +619,8 @@
 		6B5B60752B3E665E009A2AE2 /* filePathCreatPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = filePathCreatPopView.m; sourceTree = "<group>"; };
 		6B5B60782B3E71B6009A2AE2 /* filePathCreatTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = filePathCreatTableViewCell.h; sourceTree = "<group>"; };
 		6B5B60792B3E71B6009A2AE2 /* filePathCreatTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = filePathCreatTableViewCell.m; sourceTree = "<group>"; };
+		6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldPhoneCommonModel.h; sourceTree = "<group>"; };
+		6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = couldPhoneCommonModel.m; sourceTree = "<group>"; };
 		6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordTableViewHeadView.h; sourceTree = "<group>"; };
 		6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordTableViewHeadView.m; sourceTree = "<group>"; };
 		6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordEditBottomView.h; sourceTree = "<group>"; };
@@ -892,6 +896,8 @@
 				6B21708B2B14BDAA00656670 /* couldphoneSysInfoModel.m */,
 				6BA533362B16E65500D1CB5C /* TvStatusModel.h */,
 				6BA533372B16E65500D1CB5C /* TvStatusModel.m */,
+				6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */,
+				6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -1881,6 +1887,7 @@
 				6B0582852B0457C400D37290 /* uploadFileManager.h in Headers */,
 				6BFF268C2AF8E1C600FCB4F7 /* forgetPwdViewController.h in Headers */,
 				6BF52C992AD5546500A617DB /* Reachability.h in Headers */,
+				6B5D40152B47F27A000965CF /* couldPhoneCommonModel.h in Headers */,
 				18BB18412AC417CB00A36F63 /* RYShearDeviceUDPManager.h in Headers */,
 				184C8AD52A949D5900F26650 /* AboutViewController.h in Headers */,
 				6B0581A22AFCF50300D37290 /* AJPhotoListCell.h in Headers */,
@@ -2306,6 +2313,7 @@
 				A031DD7527EC507000909527 /* HWAddFolderViewController.m in Sources */,
 				186820222AB98600005702A6 /* QRCodeScanViewController.m in Sources */,
 				6B2170892B1444CC00656670 /* allVersionView.m in Sources */,
+				6B5D40162B47F27A000965CF /* couldPhoneCommonModel.m in Sources */,
 				187076782A9F400300F15F7F /* PlayerLoadingView.m in Sources */,
 				A08A950127E9A4E400C544BB /* FMDatabaseAdditions.m in Sources */,
 				A08A94FB27E9A4E400C544BB /* BGDB.m in Sources */,

+ 7 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -91,8 +91,15 @@ UIKIT_EXTERN NSString *const Const_file_Transfe_canUse_Cellular;
 
 /*标记是否低电量上传下载*/
 UIKIT_EXTERN NSString *const Const_file_Transfe_battery_level;
+
 /*相册备份是否开启*/
 UIKIT_EXTERN NSString *const Const_photo_backups_state;
+
+/*标记是否使用流量备份*/
+UIKIT_EXTERN NSString *const Const_file_backups_canUse_Cellular;
+
+/*标记是否低电量备份*/
+UIKIT_EXTERN NSString *const Const_file_backups_battery_level;
 @end
 
 NS_ASSUME_NONNULL_END

+ 5 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -91,4 +91,9 @@ NSString *const Const_file_Transfe_battery_level  = @"file_Transfe_battery_level
 /*相册备份是否开启*/
 NSString *const Const_photo_backups_state = @"photo_backups_state";
 
+/*标记是否使用流量备份*/
+NSString *const Const_file_backups_canUse_Cellular = @"file_backups_canUse_Cellular";
+
+/*标记是否低电量备份*/
+NSString *const Const_file_backups_battery_level = @"file_backups_battery_level";
 @end

+ 5 - 0
创维盒子/双子星云手机/AppDelegate/Config/Notification.h

@@ -76,6 +76,11 @@
 /*备份文件更新通知*/
 #define backupsFileRefreshNotification                 @"backupsFileRefreshNot"
 
+/* 创建文件夹通知*/
+#define createFolderBeginNotification                 @"createFolderBeginNot"
+/* 创建文件夹通知*/
+#define createFolderDoneNotification                 @"createFolderDoneNot"
+
 /*获取云机基本信息通知*/
 #define getCouldPhoneBaseInfoNotification                 @"getCouldPhoneBaseInfoNot"
 

+ 5 - 4
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.m

@@ -161,6 +161,7 @@
 - (void)didClickTailViewFun
 {
     fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
+    vc.curType = 2;
     [self.navigationController pushViewController:vc animated:YES];
 }
 
@@ -198,7 +199,7 @@
     if (row == 0){
         [cell.titleLabel setText:NSLocalizedString(@"File_backups_set_Cellular",nil)];
         
-        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_Transfe_canUse_Cellular];
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_backups_canUse_Cellular];
         [cell.maskSwitch setOn:haveOpenMask];
         
         /*上圆角*/
@@ -214,7 +215,7 @@
     }else if (row == 1){
         [cell.titleLabel setText:NSLocalizedString(@"File_backups_set_battery_level",nil)];
  
-        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_Transfe_battery_level];
+        BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_file_backups_battery_level];
         [cell.maskSwitch setOn:haveOpenMask];
 
         /*下圆角*/
@@ -245,10 +246,10 @@
 - (void)didClickSwitchBy:(BOOL)SwitchOn withRow:(NSInteger)row
 {
     if(row == 0){
-        [HWDataManager setBoolWithKey:Const_file_Transfe_canUse_Cellular value:SwitchOn];
+        [HWDataManager setBoolWithKey:Const_file_backups_canUse_Cellular value:SwitchOn];
     }
     else{
-        [HWDataManager setBoolWithKey:Const_file_Transfe_battery_level value:SwitchOn];
+        [HWDataManager setBoolWithKey:Const_file_backups_battery_level value:SwitchOn];
     }
 }
 

+ 1 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransfeSetViewController.m

@@ -160,6 +160,7 @@
 - (void)didClickTailViewFun
 {
     fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
+    vc.curType = 1;
     [self.navigationController pushViewController:vc animated:YES];
 }
 

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.h

@@ -10,7 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface fileTransferPathCheckViewController : BaseViewController
-
+@property(nonatomic,assign) NSInteger curType;// 1上传 2是备份
 @end
 
 NS_ASSUME_NONNULL_END

+ 36 - 5
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.m

@@ -23,9 +23,11 @@
     [self.toolBar setHidden:YES];
     [self.navigationBar setHidden:YES];
     [self.navBarBGView setHidden:NO];
-    [self.titleLabel setText:NSLocalizedString(@"File_upload_path_check",nil)];
+    //[self.titleLabel setText:NSLocalizedString(@"File_upload_path_check",nil)];
     [self.view setBackgroundColor:HWF5F7FAColor];
     
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(createFolderDoneNotFun:) name:createFolderBeginNotification object:nil];
+    
     [self drawAnyView];
     [self setupKeyboardManager];
 }
@@ -65,6 +67,13 @@
     [super viewWillAppear:animated];
     IQKeyboardManager *keyboardManager = [IQKeyboardManager sharedManager];
     keyboardManager.enable = YES;
+    
+    if(_curType == 2){
+        [self.titleLabel setText:NSLocalizedString(@"File_upload_path_new_check_title",nil)];
+    }
+    else{
+        [self.titleLabel setText:NSLocalizedString(@"File_upload_path_check",nil)];
+    }
 }
 
 - (void)viewWillDisappear:(BOOL)animated
@@ -191,9 +200,31 @@
     //[self.view.window addSubview:filePathCreatPopV];
     [self.view addSubview:filePathCreatPopV];
     
-//    KWeakSelf
-//    filePathCreatPopV.didClickBut = ^(NSInteger tag) {
-//        
-//    };
+    filePathCreatPopV.curType = _curType;
+    
+    KWeakSelf
+    filePathCreatPopV.didClickOkBut = ^(NSString * _Nonnull folderName) {
+        [weakSelf didGetFolderName:folderName];
+    };
+}
+
+#pragma mark
+- (void)didGetFolderName:(NSString*)folderName
+{
+    [[NSNotificationCenter defaultCenter] postNotificationName:createFolderBeginNotification object:folderName];/*发送通知*/
+}
+
+- (void)createFolderDoneNotFun:(NSNotification *)notification
+{
+    NSNumber *stateNumber = [notification object];
+    
+    NSString * tipStr = NSLocalizedString(@"File_upload_path_new_suc",nil);
+     
+    if(stateNumber.integerValue !=0 ){
+        tipStr = NSLocalizedString(@"File_upload_path_new_fail",nil);
+    }
+    
+    [[iToast makeText:tipStr] show];
+    
 }
 @end

+ 2 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/filePathCreatPopView.h

@@ -10,7 +10,8 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface filePathCreatPopView : UIView
-@property (nonatomic,copy) void (^didClickBut)(NSInteger tag);
+@property(nonatomic,assign) NSInteger curType;// 1上传 2是备份
+@property (nonatomic,copy) void (^didClickOkBut)(NSString* folderName);
 @end
 
 NS_ASSUME_NONNULL_END

+ 18 - 4
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/view/filePathCreatPopView.m

@@ -362,11 +362,25 @@
 
 - (void)didClickButtonFun:(UIButton*)button
 {
-    [self deleteFromSuperview];
+    NSInteger tag = button.tag;
     
-    if(_didClickBut)
-    {
-        _didClickBut(1);
+    if(tag == 1){
+        [self deleteFromSuperview];
     }
+    else if(tag == 2){
+        NSString* folderName = filePathNameTF.text;
+        if(!folderName || folderName.length ==0){
+            [[iToast makeText:NSLocalizedString(@"File_upload_path_new_input_tip",nil)] show];
+            return;
+        }
+        
+        [self deleteFromSuperview];
+        
+        if(_didClickOkBut)
+        {
+            _didClickOkBut(folderName);
+        }
+    }
+    
 }
 @end

+ 7 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/model/photosBackupsTaskModel.h

@@ -18,6 +18,12 @@ typedef enum{
     backupsStateDone,//
 }backupsStateType;
 
+typedef enum{
+    backupsSuspendNone = 0,
+    backupsSuspendByOther,
+    backupsSuspendByUser,//
+}backupsSuspendType;
+
 @interface photosBackupsTaskModel : JSONModel
 @property (nonatomic, assign) NSInteger count;       ///< Count of photos the album contain
 //@property (nonatomic, strong) PHFetchResult *result;
@@ -31,7 +37,7 @@ typedef enum{
 
 @property (nonatomic, assign) NSUInteger failCount;
 @property (nonatomic, assign) NSUInteger didBackupsCount;
-@property (nonatomic, assign) BOOL isSuspendType;
+@property (nonatomic, assign) backupsSuspendType isBackupsSuspendType;
 @property (nonatomic, assign) backupsStateType curBackupsState;
 @property (nonatomic, copy) NSString *backupsTipMsg;//备份失败消息等
 

+ 1 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/backupsFilerecordTableView.m

@@ -439,7 +439,7 @@
 - (void)handleBackupsingStateTapFunBy:(BOOL)isSuspendType  with:(photosBackupsTaskModel*)model
 {
     if (isSuspendType) {
-        model.isSuspendType = YES;
+        model.isBackupsSuspendType = backupsSuspendByUser;
         model.curBackupsState = backupsStateSuspend;
         
         [[backupsFileManager shareInstance] suspendBackupsFileFun];

+ 3 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.h

@@ -34,6 +34,9 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)suspendBackupsFileFun;
 //文件重新备份
 - (void)reBackupsFileFunBy:(photosBackupsTaskModel*)model;
+
+//检查是否需要重新备份
+- (void)checkReBackupsFileFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 45 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/backupsFileManager.m

@@ -60,7 +60,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
         
         HLog(@"1 bg_id:%@",lastModel.bg_id);
         
-        if(lastModel.isSuspendType){
+        if(lastModel.isBackupsSuspendType == backupsSuspendByUser){
             return;
         }
         
@@ -123,6 +123,9 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
 - (void)handelBackupsModelFun:(photosBackupsTaskModel*)backupsTaskModel
 {
     _curPhotosBackupsTaskMod = backupsTaskModel;
+    _curPhotosBackupsTaskMod.isBackupsSuspendType = backupsSuspendNone;
+    _curPhotosBackupsTaskMod.curBackupsState = backupsStateUploading;
+    
     _curPhotosBackupsTaskMod.LocalIdentifierArr = [backupsTaskModel.totalLocalIdentifier componentsSeparatedByString:@"&"];
     
     if(_curPhotosBackupsTaskMod.LocalIdentifierArr.count
@@ -280,7 +283,7 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
 //文件重新备份
 - (void)reBackupsFileFunBy:(photosBackupsTaskModel*)model
 {
-    model.isSuspendType = NO;
+    model.isBackupsSuspendType = backupsSuspendNone;
     model.curBackupsState = backupsStateUploading;
     _curPhotosBackupsTaskMod = model;
     
@@ -291,4 +294,44 @@ static backupsFileManager * cur_backupsFileShareInstance = nil;
     }];
     
 }
+
+//检查是否需要重新备份
+- (void)checkReBackupsFileFun
+{
+    BOOL haveOpenBackups = [HWDataManager getBoolWithKey:Const_photo_backups_state];
+    
+    if(!haveOpenBackups){
+        return;
+    }
+    
+    //相册权限
+    if (![[TZImageManager manager] authorizationStatusAuthorized]){
+        [HWDataManager setBoolWithKey:Const_photo_backups_state value:NO];
+        return;
+    }
+    
+    
+    [photosBackupsTaskModel bg_findAsync:backups_photos_tableName limit:1 orderBy:nil desc:YES complete:^(NSArray * _Nullable array) {
+        if(!array || array.count == 0){
+            return;
+        }
+        
+        photosBackupsTaskModel *lastModel = array.firstObject;
+        
+        HLog(@"1 bg_id:%@",lastModel.bg_id);
+        
+        if(lastModel.isBackupsSuspendType == backupsSuspendByUser){
+            return;
+        }
+        
+        if(lastModel.curBackupsState == backupsStateFail
+           ||lastModel.curBackupsState == backupsStateDone){//上次备份完成
+            
+        }
+        else{//继续上次的备份任务
+            [self handelBackupsModelFun:lastModel];
+        }
+    }];
+    
+}
 @end

+ 18 - 0
创维盒子/双子星云手机/CloudPlayer/Model/couldPhoneCommonModel.h

@@ -0,0 +1,18 @@
+//
+//  couldPhoneCommonModel.h
+//  隐私保护
+//
+//  Created by xd h on 2024/1/5.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface couldPhoneCommonModel : SuperModel
+@property (nonatomic, copy) NSString * msg;
+@property (nonatomic, assign) NSInteger status;
+@property (nonatomic, copy) NSString * type;
+@end
+
+NS_ASSUME_NONNULL_END

+ 12 - 0
创维盒子/双子星云手机/CloudPlayer/Model/couldPhoneCommonModel.m

@@ -0,0 +1,12 @@
+//
+//  couldPhoneCommonModel.m
+//  隐私保护
+//
+//  Created by xd h on 2024/1/5.
+//
+
+#import "couldPhoneCommonModel.h"
+
+@implementation couldPhoneCommonModel
+
+@end

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+backupsFile.h

@@ -8,7 +8,7 @@
 #import "PlayerViewController.h"
 #import "uploadFileDataModel.h"
 #import "RCCommandHelp.h"
-#import "uploadFileManager.h"
+//#import "uploadFileManager.h"
 #import "cachesFileManager.h"
 #import <MJExtension.h>
 #import "connectDeviceManager.h"

+ 16 - 2
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+backupsFile.m

@@ -264,7 +264,20 @@
 #pragma mark 处理上传过程
 - (void)handleBackupsingFun:(NSNumber*)fileLengthNum
 {
-    if(self.curPhotosBackupsTaskMod.isSuspendType){
+    BOOL isCanUseCellular = [HWDataManager getBoolWithKey:Const_file_backups_canUse_Cellular];
+    
+    if(!isCanUseCellular){//不允许流量备份
+        //
+        if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusReachableViaWWAN){
+            self.curPhotosBackupsTaskMod.isBackupsSuspendType = backupsSuspendByOther;
+            self.curPhotosBackupsTaskMod.curBackupsState = backupsStateSuspend;
+            [[backupsFileManager shareInstance] changeBackupsFileStateWithSpeedFun];
+        }
+        
+    }
+    
+    
+    if(self.curPhotosBackupsTaskMod.isBackupsSuspendType != backupsSuspendNone){
         [self clearBackupsFileDataFun];
         return;
     }
@@ -420,7 +433,8 @@
     
     //msgType
     //unsigned char msgType = 12;
-    unsigned char msgType = 15;
+    //unsigned char msgType = 15;
+    unsigned char msgType = 16;
     NSData *msgTypeData = [NSMutableData dataWithBytes:&msgType length:sizeof(msgType)];
     //HLog(@"msgTypeData:%@",msgTypeData);
     

+ 4 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.h

@@ -6,6 +6,7 @@
 //
 
 #import "PlayerViewController.h"
+#import "couldPhoneCommonModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -23,6 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
 - (void)getCouldPhoneBaseInfoResponseFun:(NSDictionary *)dataDict;
 - (void)getCouldPhoneSysInfoResponseFun:(NSDictionary *)dataDict;
 - (void)getCouldPhoneTvStatusResponseFun:(NSDictionary *)dataDict;
+
+- (void)createFolderBeginNotFun:(NSNotification *)notification;
+- (void)createFolderResponseFun:(NSDictionary *)dataDict;
 @end
 
 NS_ASSUME_NONNULL_END

+ 19 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -202,5 +202,24 @@
     [self.view bringSubviewToFront:RenewTipView];
 }
 
+- (void)createFolderBeginNotFun:(NSNotification *)notification
+{
+    NSString *folderName = [notification object];
+    
+    if(folderName && folderName.length >0){
+        NSString * commandStr = [RCCommandHelp applyForCreateFolderwithFolderName:folderName];
+        [self.commandChannelManager rc_sendData:commandStr];
+    }
+}
+
+- (void)createFolderResponseFun:(NSDictionary *)dataDict
+{
+    couldPhoneCommonModel *model = [[couldPhoneCommonModel alloc] initWithDictionary:dataDict error:nil];
+    
+    if(model){
+        NSNumber *curNum = [NSNumber numberWithInteger:model.status];
+        [[NSNotificationCenter defaultCenter] postNotificationName:createFolderDoneNotification object:curNum];/*发送通知*/
+    }
+}
 
 @end

+ 1 - 0
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.h

@@ -22,6 +22,7 @@
 #import "imageVersionRenewTipView.h"
 #import "backupsFileManager.h"
 #import "photosBackupsTaskModel.h"
+#import "AFNetworkReachabilityManager.h"
 
 @protocol PlayerViewControllerDelegate <NSObject>
 

+ 8 - 1
创维盒子/双子星云手机/CloudPlayer/PlayerViewController.mm

@@ -14,7 +14,7 @@
 #import "PlayerViewController+upLoadFile.h"
 #import "PlayerViewController+backupsFile.h"
 
-#import "AFNetworkReachabilityManager.h"
+
 #import <AVFoundation/AVFoundation.h>
 
 #import <ifaddrs.h>
@@ -737,6 +737,9 @@ ComontAlretViewControllerDelegate>
             else if ([messageType isEqualToString:@"reboot"]){/*重启*/
                 [weakSelf stopForceStartTimerFun];
             }
+            else if ([messageType isEqualToString:@"mkdir"]){/*创建文件夹*/
+                [weakSelf stopForceStartTimerFun];
+            }
         } failure:^(NSError *error) {
             [self showNetErrorAlertFun:2];
         }];
@@ -2024,6 +2027,8 @@ NSDate *lastVideoTome;/*上一帧数据时间*/
                 [self showNewIndicator];
             });
             [self tryAgain];
+            
+            [[backupsFileManager shareInstance] checkReBackupsFileFun];
         }
             break;
             
@@ -2297,6 +2302,8 @@ BOOL inReconnect = NO;
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(suspendUploadFileFun:) name:uploadFileSuspendNotification object:nil];
     
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(beginGotoBackupsFileFun:) name:backupsFileBeginNotification object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(createFolderBeginNotFun:) name:createFolderBeginNotification object:nil];
 }
 
 - (void)removeNSNotification

+ 9 - 1
创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.h

@@ -199,10 +199,18 @@ NS_ASSUME_NONNULL_BEGIN
 /**
  * @brief 申请备份文件 请求
  *
- * @param taskUid
+ * @param taskUid taskUid
  * @param fileName 传file name
  */
 + (NSString *)applyForBackupsFileBy:(NSString*)taskUid withFileName:(NSString *)fileName withSavePath:(NSString *)savePath;
+
+/**
+ * @brief 创建文件夹
+ *
+ * @param folderName  folderName
+ */
++ (NSString *)applyForCreateFolderwithFolderName:(NSString *)folderName;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 18 - 0
创维盒子/双子星云手机/CloudPlayer/RCCommandHelp.m

@@ -1011,4 +1011,22 @@
     
     return dataStr;
 }
+
++ (NSString *)applyForCreateFolderwithFolderName:(NSString *)folderName
+{
+    NSString * name = [[NSString alloc] initWithFormat:@"sdcard/%@",folderName];
+    NSString *dataStr =[NSString stringWithFormat:@"{\"data\":{\"path\":\"%@\"},\"type\":\"mkdir\"}",name];
+    
+    if (USENEWCONTROLLCOMMONDNO500)
+    {
+//        dataStr = [self commondAppendingHeadAndEndStrWithSourStr:dataStr];
+    }
+    else
+    {
+        dataStr = [self commandAppending00StringWithSourStr:dataStr];
+    }
+    
+    return dataStr;
+}
+
 @end

+ 3 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -333,6 +333,9 @@
 "File_upload_path_way"   = "文件默认上传至:";
 "File_upload_path_check"   = "选择上传路径";
 "File_upload_path_new"   = "新建路径";
+"File_upload_path_new_suc"   = "文件夹创建成功";
+"File_upload_path_new_fail"   = "文件夹创建失败";
+"File_upload_path_new_check_title"   = "选择备份路径";
 "File_upload_path_new_check_tip"   = "选择备份路径:";
 "File_upload_path_new_name_tip"   = "新建文件夹名称:";
 "File_upload_path_new_input_tip"   = "请输入文件夹名称";