浏览代码

1.隐私模式开关以及翻转退出开关

huangxiaodong 1 年之前
父节点
当前提交
dae5648def

+ 3 - 1
创维盒子/双子星云手机/AppDelegate/AppDelegate.m

@@ -12,6 +12,7 @@
 #import "DDYLanguageTool.h"
 #import "AFNetworkReachabilityManager.h"
 #import "PLeakSniffer.h"
+#import "connectDeviceManager.h"
 
 @interface AppDelegate (){
     CMMotionManager *cmManager;
@@ -71,7 +72,8 @@
         if (rotationGravityz > 0.85){
             
             BOOL haveOpenMask = [HWDataManager getBoolWithKey:Consn_Fanzhuan_Exit_app_Open];
-            if (haveOpenMask){
+            BOOL isPrivacyMode = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
+            if (haveOpenMask && isPrivacyMode){
                 exit(0);/*强制退出app*/
             }
         }

+ 1 - 2
创维盒子/双子星云手机/Class/Guide/inputPWDViewController.m

@@ -486,11 +486,10 @@
 {
     //隐私模式验证密码 不走后续流程
     if(_isCheckPwdType){
+        [self.navigationController popViewControllerAnimated:NO];
         if(_didInputRightPwdFun){
             _didInputRightPwdFun();
         }
-        
-        [self.navigationController popViewControllerAnimated:YES];
         return;
     }
     

+ 17 - 1
创维盒子/双子星云手机/Class/Set/MySetViewController.m

@@ -26,6 +26,7 @@
 #import "uploadFileRecordViewController.h"
 #import "privacyModeViewController.h"
 #import "TvStatusModel.h"
+#import "inputPWDViewController.h"
 
 @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
 {
@@ -358,15 +359,23 @@
 }
 
 
+
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
     [tableView deselectRowAtIndexPath:indexPath animated:YES];
     
     NSInteger row = indexPath.row;
     if (0 == row){
         
-        privacyModeViewController *nextVC = [[privacyModeViewController alloc] init];
+        inputPWDViewController *nextVC = [inputPWDViewController new];
+        nextVC.isCheckPwdType = YES;
         [self.navigationController pushViewController:nextVC animated:YES];
         
+        KWeakSelf
+        nextVC.didInputRightPwdFun = ^{
+            [weakSelf gotoPrivacyModeVCFun];
+        };
+        
+        
         /*修改密码*/
 //        ModifyPWDFirstViewController *nextVC = [[ModifyPWDFirstViewController alloc] init];
 //        [self.navigationController pushViewController:nextVC animated:YES];
@@ -422,6 +431,13 @@
     }
 }
 
+#pragma mark 去设置隐私
+- (void)gotoPrivacyModeVCFun
+{
+    privacyModeViewController *nextVC = [[privacyModeViewController alloc] init];
+    [self.navigationController pushViewController:nextVC animated:YES];
+}
+
 - (void)CommonAlertokBtnClickPressed{
 //    /*重启云手机*/
 //  通过指令通道发送 {"type":"reboot"}

+ 14 - 7
创维盒子/双子星云手机/Class/Set/privacyMode/privacyModeViewController.m

@@ -231,15 +231,17 @@
 - (void)maskSwitchPressed:(UISwitch *)privacySwitch{
     [self setPrivacySwitchStateFun];
     
-    inputPWDViewController *nextVC = [inputPWDViewController new];
-    nextVC.isCheckPwdType = YES;
-    [self.navigationController pushViewController:nextVC animated:YES];
+//    inputPWDViewController *nextVC = [inputPWDViewController new];
+//    nextVC.isCheckPwdType = YES;
+//    [self.navigationController pushViewController:nextVC animated:YES];
+//    
+//    KWeakSelf
+//    nextVC.didInputRightPwdFun = ^{
+//        [weakSelf updatePrivacyModeFun];
+//    };
     
-    KWeakSelf
-    nextVC.didInputRightPwdFun = ^{
-        [weakSelf updatePrivacyModeFun];
-    };
     
+    [self updatePrivacyModeFun];
 }
 
 #pragma mark 设置tabview 是否隐藏
@@ -289,6 +291,11 @@
            [connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode = ![connectDeviceManager shareInstance].DeviceThirdIdMod.data.isPrivacyMode;
            
            [weakSelf setPrivacySwitchStateFun];
+           
+           if(!haveOpenMask)
+           {
+               [HWDataManager setBoolWithKey:Consn_Fanzhuan_Exit_app_Open value:NO];
+           }
        }
        else
        {