Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always hide splashscreen on wakeup (VO-267) #1139

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

acezard
Copy link
Contributor

@acezard acezard commented Jan 22, 2024

On appStart the homeview will hide the splashscreen
On wakeup, it is more ambiguous so we force it

On appStart the homeview will hide the splashscreen
On wakeup, it is more ambiguous so we force it
@@ -32,6 +36,10 @@ const handleWakeUp = async (
}

await handleSecurityFlowWakeUp(client)

// On appStart the homeview will hide the splashscreen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even if this is not the "home cozy app" displayed inside the homeview?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acezard I think that I already answered this question during a visio call with @Crash--

For now HomeView only render the cozy-home app. And if, in the future, we plan to replace this in some context, then calling hideSplashScreen() should be part of the contract.

However if I remember correctly, @Crash-- was thinking about default cozy-app. Then here we display them in the CozyAppScreen. In that case, the HomeView will be still displayed in the background.


// On appStart the homeview will hide the splashscreen
// On wakeup, it is more ambiguous so we force it
if (!isAppStart) await hideSplashScreen(lockScreens.LOCK_SCREEN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If you use lockScreens.LOCK_SCREEN enum here, then you should use it also in line 23


// On appStart the homeview will hide the splashscreen
// On wakeup, it is more ambiguous so we force it
if (!isAppStart) await hideSplashScreen(lockScreens.LOCK_SCREEN)
Copy link
Member

@Ldoppea Ldoppea Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this hideSplashScreen(lockScreens.LOCK_SCREEN) should be called in LockScreenWrapper instead.
We can put it next to hideSplashScreen() so we hide both the initial SplashScreen and the LockScreen one.

I think this should work because other "non lock" scenarios already hides this splashscreen on SecurityService:61 and SecurityService:207

@acezard acezard merged commit 0a6c6e3 into master Jan 29, 2024
1 check passed
@acezard acezard deleted the fix--always-hide-splashscreen-on-wakeup branch January 29, 2024 10:46
Ldoppea added a commit that referenced this pull request Feb 28, 2024
With previous implementation we blindly hid the LOCK_SCREEN's splash
screen when the app would resume

This was made in #1139 to ensure we don't forget any path

But we found that this approach is too naive as it would fail when the
app requests a restart

This is because, on Android, when the app requests a restart, the
current Activity is not directly destroyed and the app react as if it
was sent to `background`. In that scenario the hook would show the
LOCK_SCREEN's splash screen and then would fail to hide it, as it would
consider the app is starting from scratch

This side effect has been fixed in previous commit as the entire
component's tree is now unmount before restart and so the LOCK_SCREEN
is not shown anymore. But we still want to revert to specificly placed
call instead of global one, so we have better control on what is
happening

Related PR: #1139
Ldoppea added a commit that referenced this pull request Feb 29, 2024
With previous implementation we blindly hid the LOCK_SCREEN's splash
screen when the app would resume

This was made in #1139 to ensure we don't forget any path

But we found that this approach is too naive as it would fail when the
app requests a restart

This is because, on Android, when the app requests a restart, the
current Activity is not directly destroyed and the app react as if it
was sent to `background`. In that scenario the hook would show the
LOCK_SCREEN's splash screen and then would fail to hide it, as it would
consider the app is starting from scratch

This side effect has been fixed in previous commit as the entire
component's tree is now unmount before restart and so the LOCK_SCREEN
is not shown anymore. But we still want to revert to specificly placed
call instead of global one, so we have better control on what is
happening

Related PR: #1139
Ldoppea added a commit that referenced this pull request Feb 29, 2024
With previous implementation we blindly hid the LOCK_SCREEN's splash
screen when the app would resume

This was made in #1139 to ensure we don't forget any path

But we found that this approach is too naive as it would fail when the
app requests a restart

This is because, on Android, when the app requests a restart, the
current Activity is not directly destroyed and the app react as if it
was sent to `background`. In that scenario the hook would show the
LOCK_SCREEN's splash screen and then would fail to hide it, as it would
consider the app is starting from scratch

This side effect has been fixed in previous commit as the entire
component's tree is now unmount before restart and so the LOCK_SCREEN
is not shown anymore. But we still want to revert to specificly placed
call instead of global one, so we have better control on what is
happening

Related PR: #1139
Ldoppea added a commit that referenced this pull request Feb 29, 2024
With previous implementation we blindly hid the LOCK_SCREEN's splash
screen when the app would resume

This was made in #1139 to ensure we don't forget any path

But we found that this approach is too naive as it would fail when the
app requests a restart

This is because, on Android, when the app requests a restart, the
current Activity is not directly destroyed and the app react as if it
was sent to `background`. In that scenario the hook would show the
LOCK_SCREEN's splash screen and then would fail to hide it, as it would
consider the app is starting from scratch

This side effect has been fixed in previous commit as the entire
component's tree is now unmount before restart and so the LOCK_SCREEN
is not shown anymore. But we still want to revert to specificly placed
call instead of global one, so we have better control on what is
happening

Related PR: #1139
Ldoppea added a commit that referenced this pull request Feb 29, 2024
With previous implementation we blindly hid the LOCK_SCREEN's splash
screen when the app would resume

This was made in #1139 to ensure we don't forget any path

But we found that this approach is too naive as it would fail when the
app requests a restart

This is because, on Android, when the app requests a restart, the
current Activity is not directly destroyed and the app react as if it
was sent to `background`. In that scenario the hook would show the
LOCK_SCREEN's splash screen and then would fail to hide it, as it would
consider the app is starting from scratch

This side effect has been fixed in previous commit as the entire
component's tree is now unmount before restart and so the LOCK_SCREEN
is not shown anymore. But we still want to revert to specificly placed
call instead of global one, so we have better control on what is
happening

Related PR: #1139
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants