Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

When Battery Saver mode changes, the app crashes #1399

Closed
jonalmeida opened this issue Apr 5, 2019 · 5 comments
Closed

When Battery Saver mode changes, the app crashes #1399

jonalmeida opened this issue Apr 5, 2019 · 5 comments
Assignees
Labels
🐞 bug Crashes, Something isn't working, ..

Comments

@jonalmeida
Copy link
Contributor

jonalmeida commented Apr 5, 2019

STR

  1. Change theme option to 'Set by Battery Saver'.
  2. Enable Battery Saver mode (from the Quick Settings).
  3. Observe the crash.

https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/5486466/

NullPointerException: Attempt to invoke virtual method 'android.os.Looper android.app.ActivityThread.getLooper()' on a null object reference
    at android.app.Activity.recreate(Activity.java:5584)
    at androidx.core.app.ActivityCompat.recreate(ActivityCompat.java:2)
    at androidx.appcompat.app.AppCompatDelegateImpl.applyDayNight(AppCompatDelegateImpl.java:30)
    at androidx.appcompat.app.AppCompatDelegateImpl.attachBaseContext(AppCompatDelegateImpl.java:1)
    at androidx.appcompat.app.AppCompatActivity.attachBaseContext(AppCompatActivity.java:2)
...
(15 additional frame(s) were not displayed)

RuntimeException: Unable to start activity ComponentInfo{org.mozilla.fenix/org.mozilla.fenix.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Looper android.app.ActivityThread.getLooper()' on a null object reference
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
    at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:4823)
    at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4732)
    at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:69)
...
(9 additional frame(s) were not displayed)

Unable to start activity ComponentInfo{org.mozilla.fenix/org.mozilla.fenix.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Looper android.app.ActivityThread.getLooper()' on a null object reference

┆Issue is synchronized with this Jira Task

@jonalmeida jonalmeida added the 🐞 bug Crashes, Something isn't working, .. label Apr 5, 2019
@jonalmeida
Copy link
Contributor Author

cc: @ekager since it looks like it's still being worked on and this bug might already be addressed in any currently open PRs.

@ekager
Copy link
Contributor

ekager commented Apr 5, 2019

Thanks for the cc!

I dug a little deeper and there's a note in the docs under MODE_NIGHT_AUTO_BATTERY

Please note: this mode should only be used when running on devices which do not provide a similar device-wide setting.

I think because Pixels (and other phone's on P+ maybe?) automatically change the system mode to dark on battery saver mode anyway we should remove the battery saver option because "follow system" is doing the same thing (and I think this is related to the crash). If anyone has insight into if any, and which devices should have this setting, please let me know.

@ekager ekager self-assigned this Apr 5, 2019
ekager added a commit to ekager/fenix that referenced this issue Apr 5, 2019
ekager added a commit to ekager/fenix that referenced this issue Apr 5, 2019
@ekager ekager added this to the Sprint 4-1 (Milestone 4) milestone Apr 5, 2019
@ekager ekager added the eng:qa:needed QA Needed label Apr 8, 2019
@bsurd
Copy link

bsurd commented Apr 9, 2019

Tested on 6 different devices but I was not able to reproduce the initial crash on older builds so I can't really confirm if this is fixed or not. @jonalmeida could you confirm this on your device?

I did encounter a different issue while testing and logged #1484 for it. Devices used are also mentioned there.

@bsurd bsurd removed the eng:qa:needed QA Needed label Apr 9, 2019
@ekager
Copy link
Contributor

ekager commented Apr 9, 2019

Going to close this since you weren't able to reproduce.

@ekager ekager closed this as completed Apr 9, 2019
@jonalmeida
Copy link
Contributor Author

Going to close this since you weren't able to reproduce.

Yes, this isn't reproducible any more since the option is gone away from the UI.

@data-sync-user data-sync-user changed the title When Battery Saver mode changes, the app crashes FNX2-17089 ⁃ When Battery Saver mode changes, the app crashes Aug 3, 2020
@data-sync-user data-sync-user changed the title FNX2-17089 ⁃ When Battery Saver mode changes, the app crashes FNX3-15532 ⁃ When Battery Saver mode changes, the app crashes Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX3-15532 ⁃ When Battery Saver mode changes, the app crashes FNX-5001 ⁃ When Battery Saver mode changes, the app crashes Aug 11, 2020
@data-sync-user data-sync-user changed the title FNX-5001 ⁃ When Battery Saver mode changes, the app crashes When Battery Saver mode changes, the app crashes May 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Crashes, Something isn't working, ..
Projects
None yet
Development

No branches or pull requests

4 participants