From a66f62bcb727bdad4304e58538d945a1a95c0ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E7=BB=B4?= Date: Tue, 23 Jan 2024 10:07:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E5=B9=BF=E5=91=8A=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BC=98=E5=8C=96=E2=80=940122=E6=B5=8B?= =?UTF-8?q?=E8=AF=95-=E5=AE=A2=E6=88=B7=E7=AB=AF=20https://jira.shanqu.cc/?= =?UTF-8?q?browse/GHZS-4627?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gh/base/GlobalActivityLifecycleObserver.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt b/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt index 6af3e4f4e4..6f883f5e31 100644 --- a/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt +++ b/app/src/main/java/com/gh/base/GlobalActivityLifecycleObserver.kt @@ -15,13 +15,13 @@ import com.gh.gamecenter.SplashScreenActivity import com.gh.gamecenter.authorization.AuthorizationActivity import com.gh.gamecenter.common.base.GlobalActivityManager import com.gh.gamecenter.common.utils.PackageFlavorHelper -import com.gh.gamecenter.core.utils.CurrentActivityHolder.getCurrentActivity import com.gh.vspace.VHelper import com.halo.assistant.HaloApp // TODO:移动到对应的模块 class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks { - private var mIsFromBackgroundToForeground = false // 是否后台回到前台 + private var isFromBackgroundToForeground = false // 是否后台回到前台 + private var activityCount = 0 override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) { // do nothing @@ -29,8 +29,8 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks { override fun onActivityStarted(activity: Activity) { GlobalActivityManager.currentActivity = activity - - if (mIsFromBackgroundToForeground) { + activityCount ++ + if (activityCount == 1 && isFromBackgroundToForeground) { if (AdDelegateHelper.shouldShowStartUpAd(true) && !HaloApp.getInstance().isSkippingThirdParty && activity !is SplashScreenActivity @@ -40,7 +40,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks { ) { activity.startActivity(SplashAdActivity.getIntent(activity)) } - mIsFromBackgroundToForeground = false + isFromBackgroundToForeground = false } } @@ -91,7 +91,8 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks { } override fun onActivityStopped(activity: Activity) { - mIsFromBackgroundToForeground = getCurrentActivity() == null + activityCount -- + isFromBackgroundToForeground = activityCount <= 0 } override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) { From 9778cf439bb158f31ebf48a94f0dc86e47644f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E7=BB=B4?= Date: Tue, 23 Jan 2024 10:09:41 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=B9=BF=E5=91=8A=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BC=98=E5=8C=96=E2=80=940122=E6=B5=8B?= =?UTF-8?q?=E8=AF=95-=E5=AE=A2=E6=88=B7=E7=AB=AF(ci)=20https://jira.shanqu?= =?UTF-8?q?.cc/browse/GHZS-4627?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8907046ee7..ab6f08fee4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,6 +72,7 @@ android_build: only: - dev - dev-5.33.0 + - fix/GHZS-4627 # 代码检查 sonarqube_analysis: @@ -152,4 +153,5 @@ oss-upload&send-email: - /usr/local/bin/python /ci-android-mail-jira-comment.py only: - dev - - dev-5.33.0 \ No newline at end of file + - dev-5.33.0 + - fix/GHZS-4627 \ No newline at end of file From 9c8bc7742c21f52f968a05d9e5921f164e742f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E5=AD=90=E7=BB=B4?= Date: Wed, 24 Jan 2024 09:56:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Revert=20"fix:=20=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E4=BC=98=E5=8C=96=E2=80=94?= =?UTF-8?q?0122=E6=B5=8B=E8=AF=95-=E5=AE=A2=E6=88=B7=E7=AB=AF(ci)=20https:?= =?UTF-8?q?//jira.shanqu.cc/browse/GHZS-4627"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9778cf439bb158f31ebf48a94f0dc86e47644f23. --- .gitlab-ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ab6f08fee4..8907046ee7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,6 @@ android_build: only: - dev - dev-5.33.0 - - fix/GHZS-4627 # 代码检查 sonarqube_analysis: @@ -153,5 +152,4 @@ oss-upload&send-email: - /usr/local/bin/python /ci-android-mail-jira-comment.py only: - dev - - dev-5.33.0 - - fix/GHZS-4627 \ No newline at end of file + - dev-5.33.0 \ No newline at end of file