-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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 |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
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
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
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
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
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
On appStart the homeview will hide the splashscreen
On wakeup, it is more ambiguous so we force it