Explorar o código

1.合适显示密码界面再次优化

huangxiaodong hai 1 ano
pai
achega
c493f2c73e

+ 27 - 54
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -68,7 +68,6 @@
 
 @property (nonatomic, assign)  BOOL isFirstOpenInLaunch;//启动页停两秒
 
-@property (nonatomic, assign)  NSTimeInterval preEnterBackgroundTime;//记录盒子的的后台时间 用来控制进入后台一秒内回到前台不显示密码界面 (点击底部区域或下滑操作,返回输入密码界面)
 
 //冷启动分享跳入用
 @property(nonatomic, strong)   UISceneSession *session;
@@ -79,6 +78,7 @@
 
 
 - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions  API_AVAILABLE(ios(13.0)){
+    HLog(@"willConnectToSession")
     if (scene) {
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(guideOk:)  name:GuideOkNotification  object:nil];
         
@@ -566,34 +566,30 @@
 
 - (void)sceneDidDisconnect:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
     HLog(@"sceneDidDisconnect");
-    //[[boxDownloadFileManager shareInstance] suspendDownloadFileFun:YES withModel:nil withItem:nil];
     
     [[connectDeviceManager shareInstance] disconnect];
 }
 
 
 - (void)sceneDidBecomeActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    HLog(@"sceneDidBecomeActive")
+}
+
+
+- (void)sceneWillResignActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    HLog(@"sceneWillResignActive")
     
-    BOOL isPrivacyMode = [HWDataManager getBoolWithKey:Const_Have_Add_Device_Privacy_Mode];
-    if(!isPrivacyMode){
-        return;
-    }
-    
-    //控制2秒内回到前台不显示密码界面
-    long seconds =  [iTools getNowTimeStampSS];
-    if(_preEnterBackgroundTime > 0){
-        if(seconds - _preEnterBackgroundTime <= 2000){
-            return;
-        }
-    }
+}
+
+
+- (void)sceneWillEnterForeground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    HLog(@"sceneWillEnterForeground")
     
-    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
-    if (haveGuide) {
-        ;
-    }else {
-        
-        return;
-    }
+}
+
+
+- (void)sceneDidEnterBackground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
+    HLog(@"sceneDidEnterBackground")
     
     BOOL isNeeddelayedType = NO;
     //这里强制竖屏 处理图片详情 和视频详情的横屏情况
@@ -622,42 +618,10 @@
     else{
         [self showCalculatorVC];
     }
-    
-}
-
-
-- (void)sceneWillResignActive:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
-    
-    _preEnterBackgroundTime = [iTools getNowTimeStampSS];
-//    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
-//    if (haveGuide) {
-//        ;
-//    }else {
-//        
-//        return;
-//    }
-//    [self showCalculatorVC];
-}
-
-
-- (void)sceneWillEnterForeground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
-
-}
-
-
-- (void)sceneDidEnterBackground:(UIScene *)scene  API_AVAILABLE(ios(13.0)){
-//    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
-//    if (haveGuide) {
-//        ;
-//    }else {
-//        
-//        return;
-//    }
-//    [self showCalculatorVC];
 }
 
 - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
-    
+    HLog(@"scene continueUserActivity")
     if([TencentOAuth CanHandleUniversalLink:userActivity.webpageURL]){
         [TencentOAuth HandleUniversalLink:userActivity.webpageURL];
     }
@@ -668,6 +632,7 @@
 }
 
 - (void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts {
+    HLog(@"scene openURLContexts")
     NSEnumerator *enumerator = [URLContexts objectEnumerator];
     UIOpenURLContext *context;
     while (context = [enumerator nextObject]) {
@@ -781,6 +746,14 @@
         return;
     }
     
+    BOOL haveGuide = [HWDataManager getBoolWithKey:Const_Have_Show_Guide];
+    if (haveGuide) {
+        ;
+    }else {
+        
+        return;
+    }
+    
     BOOL isPrivacyMode = [HWDataManager getBoolWithKey:Const_Have_Add_Device_Privacy_Mode];
     if(!isPrivacyMode){
         return;

+ 2 - 2
创维盒子/双子星云手机/cloudPhone/websocket/webSocketManager.m

@@ -100,9 +100,9 @@ static webSocketManager *webSocketManagerInstance = nil;
     NSString *instructionsChannelUrl = [NSString stringWithFormat:@"ws://%@:%@/businessChannel",_curIp,wsPort];
     
     if (instructionsChannelUrl && instructionsChannelUrl.length > 0) { //当都有值才可连接
-        HLog(@"WebSocket11111指令通道连接开始11111 url = %@ ",instructionsChannelUrl);
+        //HLog(@"WebSocket11111指令通道连接开始11111 url = %@ ",instructionsChannelUrl);
         [self.commandChannelManager rc_openURL:instructionsChannelUrl connected:^{
-            HLog(@"WebSocket11111指令通道连接成功11111 url = %@ ",instructionsChannelUrl);
+            //HLog(@"WebSocket11111指令通道连接成功11111 url = %@ ",instructionsChannelUrl);
             if (weakSelf.commandChannelManager.rc_socketStatus == RCSocketCloudPhoneStatusConnected){
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                      [weakSelf initOtherFun];

+ 7 - 7
创维盒子/双子星云手机/connectDeviceManager/connectDeviceManager.m

@@ -639,33 +639,33 @@ static connectDeviceManager *connectDeviceManagerInstance = nil;
         return;
     }
     
-    HLog(@"WebSocket11111  hxd-1")
+    //HLog(@"WebSocket11111  hxd-1")
     //局域网不通 瑞云还没连接好
     if(!self.isPingOk && !didRuiyunLinkType){
         return;
     }
 
     //切换设备
-    HLog(@"WebSocket11111  hxd0")
+    //HLog(@"WebSocket11111  hxd0")
     if([webSocketManager shareInstance].commandChannelManager){
         
 //        [[webSocketManager shareInstance].commandChannelManager rc_close];
 //        [webSocketManager shareInstance].commandChannelManager = nil;
         ksharedAppDelegate.isWebSockLinkOKAginType = NO;
         
-        HLog(@"WebSocket11111  hxd1")
+        //HLog(@"WebSocket11111  hxd1")
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            HLog(@"WebSocket11111  hxd2")
+            //HLog(@"WebSocket11111  hxd2")
             if([connectDeviceManager shareInstance].isFirstInputPwdDone){
-                HLog(@"WebSocket11111  hxd3")
+                //HLog(@"WebSocket11111  hxd3")
                 [[webSocketManager shareInstance] opencommandChannelManagerrc_openURL];
             }
         });
     }
     else{//第一次启动
-        HLog(@"WebSocket11111  hxd10")
+        //HLog(@"WebSocket11111  hxd10")
         if([connectDeviceManager shareInstance].isFirstInputPwdDone){
-            HLog(@"WebSocket11111  hxd11")
+            //HLog(@"WebSocket11111  hxd11")
             [[webSocketManager shareInstance] opencommandChannelManagerrc_openURL];
         }
     }