wxr
2021-03-31 3532db3610381f37eca1a6ac783d882517847c91
HDL-ON_Android/Application.cs
@@ -33,7 +33,6 @@
        public override void OnCreate()
        {
            //注册未处理异常事件
            Com.Chteam.Agent.BuglyAgentHelper.Init(this.ApplicationContext, "cb89f20750");
            if (Shared.Application.Activity != null)
            {
@@ -47,6 +46,9 @@
            initAll();
        }
        /// <summary>
        /// 所有初始化全部在这个方法实现
        /// </summary>
@@ -57,11 +59,11 @@
            Manifest.Permission.Camera, Manifest.Permission.ProcessOutgoingCalls, Manifest.Permission.GetAccounts};
            //禁止屏幕长亮
            BaseActivity.KeepScreenON = false;
            //隐藏迪拜虚拟按键
            //隐藏虚拟按键
            BaseActivity.IsHideVirualButtons = true;
            //实现安卓返回按键
            BaseActivity.BackKeyAction = () => {
                MainPage.Log($"android后退");
            BaseActivity.BackKeyAction = () =>
            {
                try
                {
                    var result = MainPage.LoadEvent_BackAction();
@@ -78,9 +80,9 @@
                            break;
                    }
                }
                catch (System.Exception ezx)
                catch (Exception ex)
                {
                    Console.WriteLine(ezx.Message);
                    Console.WriteLine(ex.Message);
                }
            };
@@ -94,7 +96,11 @@
                {
                    Language.CurrentLanguage = "Chinese";
                }
                else
                {
                    Language.CurrentLanguage = "English";
                }
                //获取极光推送ID
                GetJPushRegistrationID(activity);
@@ -130,7 +136,8 @@
            BaseActivity.OnResumeAction += (activity) =>
            {
                checkSomeInfo();
            };
            BaseActivity.OnDestroyAction += (activity) =>
            {
@@ -139,7 +146,7 @@
                //UserInfo.Current.unlockTime = DateTime.Now;
            };
            HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider");
@@ -154,14 +161,14 @@
                    //关闭定位服务
                    Shared.Application.StopGPSLocationService();
                }
                  catch(Exception ex)
                catch (Exception ex)
                {
                    Utlis.WriteLine("GetCityInfo catch"+ ex.Message);
                    Utlis.WriteLine("GetCityInfo catch" + ex.Message);
                }
                MainPage.Log($"经纬度:::{lon}:{lat}");
            };
        }
        /// <summary>
@@ -170,8 +177,10 @@
        /// <param name="activity"></param>
        void GetJPushRegistrationID(BaseActivity activity)
        {
            try
            {
                //保存获取的极光服务器上的注册ID到本地文件
                var tokenID = JPushInterface.GetRegistrationID(activity);
                Console.WriteLine("RegistrationID:  " + tokenID);
@@ -361,7 +370,7 @@
            //进入后台mqtt正在连接重置状态
            HDL_ON.DAL.Mqtt.MqttClient.RemoteMqttIsConnecting = false;
            HDL_ON.DriverLayer.UdpSocket._BusSocket.Stop();
        }
        /// <summary>
@@ -374,7 +383,7 @@
            if (CloseTime.AddSeconds(10) < DateTime.Now)
            {
                //后台超过10s就断开MQTT重连
                if (HDL_ON.DriverLayer.Control.Ins.IsRemote)
                //if (HDL_ON.DriverLayer.Control.Ins.IsRemote)
                {
                    HDL_ON.DAL.Mqtt.MqttClient.DisConnectRemote("closeTime", false);
                }