wxr
2020-12-17 1a13c963a5fb8cad92bf03667e411f46d6a6a843
HDL-ON_Android/Application.cs
@@ -49,7 +49,9 @@
            string[] permissions = new string[] { Manifest.Permission.WriteExternalStorage, Manifest.Permission.RecordAudio,
            Manifest.Permission.Camera, Manifest.Permission.ProcessOutgoingCalls, Manifest.Permission.GetAccounts};
            //禁止屏幕长亮
            BaseActivity.KeepScreenON = false;
            //隐藏迪拜虚拟按键
            BaseActivity.IsHideVirualButtons = true;
            init();
            BaseActivity.OnCreateActoin += (activity, application) =>
@@ -92,15 +94,16 @@
            BaseActivity.OnResumeAction += (activity) =>
            {
                checkSomeInfo();
                new HDL_ON.UI.AppUnlockPage().LoadPage();
            };
            BaseActivity.OnDestroyAction += (activity) =>
            {
                Console.WriteLine("OnDestroyAction");
                //BusSocket.Stop();
                OnAppConfig.Instance.unlockTime = DateTime.Now;
                //UserInfo.Current.unlockTime = DateTime.Now;
            };
            HDLUtils.SetAuthoritiesName("com.hdl.onpro.fileProvider");
@@ -136,11 +139,11 @@
                //保存获取的极光服务器上的注册ID到本地文件
                var tokenID = JPushInterface.GetRegistrationID(activity);
                Console.WriteLine("RegistrationID:  " + tokenID);
                if (!string.IsNullOrEmpty(tokenID) && UserInfo.Current.PushDeviceToken != tokenID)
                if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID)
                {
                    UserInfo.Current.PushDeviceToken = tokenID;
                    UserInfo.Current.PhoneName = Android.OS.Build.Manufacturer;
                    UserInfo.Current.SaveUserInfo();
                    OnAppConfig.Instance.PushDeviceToken = tokenID;
                    OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer;
                    OnAppConfig.Instance.SaveConfig();
                }
                int loadTokenCount = 0;
                System.Threading.Tasks.Task.Run(() =>
@@ -157,11 +160,11 @@
                        }
                    }
                    Console.WriteLine("RegistrationID:  " + tokenID);
                    if (!string.IsNullOrEmpty(tokenID) && UserInfo.Current.PushDeviceToken != tokenID)
                    if (!string.IsNullOrEmpty(tokenID) && OnAppConfig.Instance.PushDeviceToken != tokenID)
                    {
                        UserInfo.Current.PushDeviceToken = tokenID;
                        UserInfo.Current.PhoneName = Android.OS.Build.Manufacturer;
                        UserInfo.Current.SaveUserInfo();
                        OnAppConfig.Instance.PushDeviceToken = tokenID;
                        OnAppConfig.Instance.PhoneName = Android.OS.Build.Manufacturer;
                        OnAppConfig.Instance.SaveConfig();
                    }
                });
@@ -273,6 +276,8 @@
            {
                Console.WriteLine("HHH OnActivityStarted:foreground");
                BusSocketStart();
                //后台回到前台
                new HDL_ON.UI.AppUnlockPage().LoadPage();
            }
        }
@@ -284,6 +289,9 @@
            {
                Console.WriteLine("HHH OnActivityStopped: background");
                BusSocketStop();
                //进入后台
                UserInfo.Current.unlockTime = DateTime.Now;
            }
        }
@@ -308,7 +316,6 @@
        {
            IsEnterBackground = true;
            //BusSocket.Stop();
            OnAppConfig.Instance.unlockTime = DateTime.Now;
        }