-
Notifications
You must be signed in to change notification settings - Fork 34
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
[native code] Experiment with entering/exiting airplane mode #1043
Comments
Airplane ModeI dug into the airplane mode a bit and wanted to get my findings out before we get swept away in the GSA project. I did not have enough time (nor a Samsung/OnePlus) to do tests with physical phones, so I did all of my work in a pixel emulator. I also didn't see an internal issue for this, I'm not sure where it is exactly, so I didn't get the chance to look at any logs. TestsI did 3 types of tests to see how airplane mode would affect the FSM. All of these tests involved me broadcasting a custom intent that would allow me to view the state of the FSM at any given time.
Potential SolutionsI know it was mentioned above that we could register for that airplane mode callback and restart the FSM, and I think thats a great idea. I have not been able to test it, however, as I am having trouble editing the Another alternative method that we can do instead is to check in Please let me know what you think @shankari, I would appreciate any feedback you may have. |
@louisg1337 You can edit the
Let us know which works best! |
Status UpdateThank you for helping me figure out the CodeFor the airplane mode change, I implemented the registering for the airplane mode receiver idea. I did run into an issue however, which is that apparently, with the new background execution limits, an app cannot register for implicit intents in the The rest of the change is straight forward with the app listening for the airplane intent in TestingTo test this I did 3 separate tests which were as follows.
All tests were successful and nothing seemed too weird. ConcernOne concern I did have though was that in Please let me know what you think @shankari, thank you! |
@louisg1337 thank you for doing this; hopefully it will make the app a lot more stable, at least for people who travel by plane. Two comments:
Once you make that change, I am happy to merge the PR |
Sounds great, thank you for the feedback! I just made both changes and they are now pushed to the PR. To also address the first bullet point, yes that is what I observed. Right when you switch to airplane mode the state is still in |
Anecdotally, I seem to remember that when I got out of airplane mode, I would frequently miss trips. I do not remember whether the foreground service was missing at the time.
The goals for this issue are to go int and out of airplane mode on both a stock android phone and a custom (Samsung/OnePlus phone) and see what happens under the hood. We can also look at my logs (in the internal issue) and see the FSM state when exiting from airplane mode.
A potential change might be to register for the "leave airplane mode" callback and reset the FSM if needed.
As a preliminary step, we can register for the "leave airplane mode" callback and log the state of the FSM and the foreground service at the time.
The text was updated successfully, but these errors were encountered: