wxr
2023-07-13 de255fa314823290a833c10d30424e42e91f56f0
安卓后台进入前台问题
8个文件已修改
57 ■■■■ 已修改文件
HDL-ON_Android/Application.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/HDLONUtils.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/SplashActivity.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/AppDelegate.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/UdpSocket.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Application.cs
@@ -125,7 +125,6 @@
                multicast.Release();
                //进入后台
                UserInfo.Current.unlockTime = DateTime.Now;
            }
        }
@@ -153,7 +152,7 @@
        /// </summary>
        void BusSocketStop()
        {
            //IsEnterBackground = true;
            CloseTime = DateTime.Now;
            MainPage.IsEnterBackground = true;
            //进入后台mqtt正在连接重置状态
@@ -167,15 +166,12 @@
        /// </summary>
        void BusSocketStart()
        {
            //IsEnterBackground = false;
            if (CloseTime.AddSeconds(10) < DateTime.Now)
            {
                //后台超过10s就断开MQTT重连
                //if (HDL_ON.DriverLayer.Control.Ins.IsRemote)
                {
                    HDL_ON.DAL.Mqtt.MqttClient.DisConnectRemote("closeTime", false);
                    HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Local = false;
                }
            }
HDL-ON_Android/Other/HDLONUtils.cs
@@ -32,12 +32,12 @@
            }
        }
        public static void StartSplashActivity()
        {
            Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity));
            Shared.Application.Activity.StartActivity(intent);
            Shared.Application.Activity.Finish();
        }
        //public static void StartSplashActivity()
        //{
        //    Intent intent = new Intent(Shared.Application.Activity, typeof(SplashActivity));
        //    Shared.Application.Activity.StartActivity(intent);
        //    Shared.Application.Activity.Finish();
        //}
    }
}
HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.8.1" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307121">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.8.1" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202307131">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <!--友盟-->
HDL-ON_Android/SplashActivity.cs
@@ -24,10 +24,6 @@
    [IntentFilter(new string[] { "com.hdl.onpro.SplashActivity", Intent.ActionView })]
    public class SplashActivity : Activity
    {
        protected override void OnActivityResult(int requestCode, Result resultVal, Intent data)
        {
            if (requestCode == 99)
@@ -54,12 +50,20 @@
        {
            base.OnCreate(savedInstanceState);
            if(Shared.Application.Activity != null && Shared.Application.Activity.GetType() == typeof(BaseActivity))
            {
                Finish();
                return;
            }
            //Intent i = new Intent(this, typeof(BaseActivity));//Intent intent=new Intent( 起始组件对象 , 目标 Service.class);
            //StartActivityForResult(i, 1);
            //OverridePendingTransition(0, 0);
            //initAll();
            if (HDL_ON.OnAppConfig.Instance.FirstRunApp || !HDL_ON.OnAppConfig.Instance.isAgreePrivacyPolicy)
            {
                //OnAppConfig.Instance.FirstRunApp = false;
                //OnAppConfig.Instance.SaveConfig();
                Language.CurrentLanguage = "Chinese";
                Locale locale1 = Locale.Default;
                var localeList = Resources.Configuration.Locale;
@@ -185,7 +189,7 @@
                }
            };
            BaseActivity.OnCreateActoin += (activity, application) =>
            BaseActivity.OnCreateActoin = (activity, application) =>
            {
                Language.CurrentLanguage = "Chinese";
                Locale locale1 = Locale.Default;
@@ -234,7 +238,7 @@
                    HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground);
                };
            };
            BaseActivity.RefreshUIAction += (activity) =>
            BaseActivity.RefreshUIAction = (activity) =>
            {
                Language.CurrentLanguage = "Chinese";
                Locale locale1 = Locale.Default;
@@ -263,11 +267,11 @@
                MainPage.Show();
                checkSomeInfo();
            };
            BaseActivity.OnResumeAction += (activity) =>
            BaseActivity.OnResumeAction = (activity) =>
            {
                checkSomeInfo();
            };
            BaseActivity.OnDestroyAction += (activity) =>
            BaseActivity.OnDestroyAction = (activity) =>
            {
                Console.WriteLine("OnDestroyAction");
                //BusSocket.Stop();
HDL-ON_iOS/AppDelegate.cs
@@ -484,7 +484,6 @@
            //进入后台mqtt正在连接重置状态
            HDL_ON.DAL.Mqtt.MqttClient.RemoteMqttIsConnecting = false;
            HDL_ON.DriverLayer.UdpSocket._BusSocket.Stop();
                    HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Local = false;
        }
HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -77,7 +77,8 @@
            }
            catch { }
            busSocket = null;
            MainPage.Log("Socket关闭");
            HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Cloud = HDL_ON.DriverLayer.Control.Ins.GatewayOnline_Local = false;
            MainPage.Log("Socket关闭");
        }
        /// <summary>
@@ -140,7 +141,6 @@
                //mqtt连接数据读取  A协议网络设备信息读取回复 处理
                if (((IPEndPoint)packet.RemoteEndPoint).Port == 8585)
                {
                    MainPage.Log($"局域网udp信息");
                    Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString());
                }
                else if (((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据
HDL_ON/DAL/ThirdPartySdk/HDLLinphone.cs
@@ -338,7 +338,7 @@
        #region ■  --  新接听和开锁接口_______________________________
        /// <summary>
        /// 开锁
        /// 可视对讲开锁
        /// </summary>
        public void HDLUnlockAction()
        {
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -269,9 +269,15 @@
        {
            Application.RunOnMainThread(() =>
            {
                if (bodyView != null)
                try
                {
                    bodyView.CheckLinkStatus();
                    if (bodyView != null)
                    {
                        bodyView.CheckLinkStatus();
                    }
                }catch(Exception ex)
                {
                    MainPage.Log($"LoadEvent_CheckLinkStatus : {ex.Message}");
                }
            });
        }