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

Freezes when opened from recent apps #1209

Open
rickmcrick opened this issue Nov 12, 2024 · 3 comments
Open

Freezes when opened from recent apps #1209

rickmcrick opened this issue Nov 12, 2024 · 3 comments

Comments

@rickmcrick
Copy link

Hello, I’m experiencing an issue with the Compose-Starter Wear OS app where it freezes when I try to re-open it from the recent apps list after the device has been idle and the screen has turned off. Here’s the sequence of events that leads to the freeze:

  1. My Wear OS device goes to sleep after about 15 seconds of inactivity. (when app closed manually everything works fine)
  2. If I wait around 2 minutes and 30 seconds, then attempt to re-open the app from the recent apps menu, the app appears frozen.
  3. No interactions are possible within the app during this freeze.

Oddly enough, if I leave the app in this frozen state and the device goes to sleep again after the usual 15-second timeout, logs appear and the frozen state seems to be gone.

I'm experiencing it with other apps (including my own app) too, maybe a Wear OS Bug? Just wanted to check if anyone knows what's the problem.

@kul3r4
Copy link
Contributor

kul3r4 commented Nov 12, 2024

If not specific to this sample (you said you can reproduce with your own app and other apps) I suggest you file a bug in https://issuetracker.google.com/issues/new?component=192711&template=840908 and attach a bugreport. You can reference that you can reproduce by using this sample.

@CorbinIvon
Copy link

CorbinIvon commented Nov 18, 2024

The app freezing issue seems to be related to how android optimizes power usage and handles app sleep cycles for Wear OS. This project may experience similar issues. If you need a workaround, please reference this GitHub repository README. It offers a solution to work around the app freezing. A bug report has been filed, and this information has been provided.

@yschimke
Copy link
Contributor

ComposeStarter doesn't feature any ambient functionality. I think if we can repro the issue, it's a platform rather than app issue.

Looking at the Flutter workaround, this opts in the app to stay open while in the background, updating once a minute.

Is that intended for your app, this is against typical app guidance which shouldn't frequently use Ambient support. Or is this purely a workaround?

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        ambientController = AmbientModeSupport.attach(this)
    }
    override fun getAmbientCallback(): AmbientModeSupport.AmbientCallback {
        return object : AmbientModeSupport.AmbientCallback() {
            override fun onEnterAmbient(ambientDetails: Bundle?) {
                super.onEnterAmbient(ambientDetails)
                // Handle entering ambient mode
            }
            override fun onExitAmbient() {
                super.onExitAmbient()
                // Handle exiting ambient mode
            }
        }
    }

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

4 participants