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

(android) Navigation does not work when the app is started while the device is locked #2370

Open
facetious opened this issue Oct 12, 2021 · 4 comments

Comments

@facetious
Copy link

facetious commented Oct 12, 2021

Environment

  • CLI: 8.1.2
  • @nativescript/core: 8.1.2
  • @nativescript/android: 8.1.1
  • @nativescript/angular: 12.2.0
  • @angular/*: 12.2.5

Describe the bug
Using ns run android when the device is locked causes navigations to not work. Angular routing is still present (as inspected via { enableTracing: true }), and components are still loaded. The new screens are not made visible, though.

Everything works as expected when the device is unlocked at the time of the app launch.

Expected behavior
Navigation should work.

Sample project
https://github.com/facetious/nativescript-angular-issue-2370

Steps to Reproduce

  1. Checkout the repo.
  2. Connect an Android device for development, but lock the screen.
  3. Run ns run android

Navigation to any item in the list is indicated in the console, but the screen does not update.

@edusperoni
Copy link
Collaborator

@facetious does this not happen with core NativeScript? I know that core stops all native updates when the screen is off, so it's probably some native updates that aren't being applied.

@facetious
Copy link
Author

@edusperoni I actually don't know. I encountered this issue because I typically have the phones locked on my desk, then unlock them when I'm testing something out. These navigations aren't triggered while the screen is locked; I am tapping on something on screen, the Angular tracing agrees, and any trace messages in put in the to-be-shown component appear as though it was presented on screen. But the screen doesn't actually navigate. The app isn't frozen; I can tap on other things and have more Angular tracing logs come out, but still no navigation.

@facetious
Copy link
Author

Disappointingly, when I have tried to reproduce this quickly in a fresh project, it doesn't happen. So I'm going to have to figure out what complicated sequence of failures has caused this to happen in my app.

@facetious
Copy link
Author

I have narrowed this issue down to an explicit navigation that is being made (after the initial Angular routing settles). If I delay the automatic "go to the next screen" until the app is in the foreground, everything operates normally. It should be possible to create a small project exhibiting this behaviour with this understanding.

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

No branches or pull requests

2 participants