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

Crash at ChromePreferenceKeyChecker #28831

Closed
AlexeyBarabash opened this issue Mar 1, 2023 · 1 comment · Fixed by brave/brave-core#17431
Closed

Crash at ChromePreferenceKeyChecker #28831

AlexeyBarabash opened this issue Mar 1, 2023 · 1 comment · Fixed by brave/brave-core#17431
Assignees
Labels
crash OS/Android Fixes related to Android browser functionality priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android ARM QA/Yes release-notes/include

Comments

@AlexeyBarabash
Copy link
Contributor

AlexeyBarabash commented Mar 1, 2023

There is a crash report on GP that indicates ChromePreferenceKeyChecker.

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4369)
  at android.app.ActivityThread.access$1600 (ActivityThread.java:268)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2106)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:201)
  at android.os.Looper.loop (Looper.java:288)
  at android.app.ActivityThread.main (ActivityThread.java:7941)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:553)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1003)
Caused by java.lang.RuntimeException:
  at org.chromium.chrome.browser.preferences.ChromePreferenceKeyChecker.checkIsKeyInUse (ChromePreferenceKeyChecker.java:69)
  at org.chromium.chrome.browser.preferences.SharedPreferencesManager.writeBoolean (SharedPreferencesManager.java:492)
  at org.chromium.chrome.browser.widget.quickactionsearchandbookmark.utils.BraveSearchWidgetUtils.setShouldShowWidgetPromo (BraveSearchWidgetUtils.java:32)
  at org.chromium.chrome.browser.widget.quickactionsearchandbookmark.QuickActionSearchAndBookmarkWidgetProvider.onReceive (QuickActionSearchAndBookmarkWidgetProvider.java:179)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4359)

Never happens on Stable and Beta builds.

Upstream's SharedPreferencesManager simplifies work with SharedPreferences , but also uses ChromePreferenceKeyChecker to allow work with only registered prefs.

Brave's code already has the places where this check is disabled with SharedPreferencesManager.getInstance().disableKeyCheckerForTesting();:

There is at least one other place I saw where check happens without disabling, the one from the above. I also could see it once.

The solution is to disable the check at the SharedPreferencesManager or ChromePreferenceKeyChecker class, at one place.

@AlexeyBarabash AlexeyBarabash added the OS/Android Fixes related to Android browser functionality label Mar 1, 2023
@AlexeyBarabash AlexeyBarabash self-assigned this Mar 1, 2023
@SergeyZhukovsky SergeyZhukovsky added priority/P2 A bad problem. We might uplift this to the next planned release. crash labels Mar 2, 2023
@AlexeyBarabash AlexeyBarabash added this to the 1.51.x - Nightly milestone Mar 2, 2023
@GeetaSarvadnya GeetaSarvadnya added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label Apr 26, 2023
@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Apr 27, 2023

Verification PASSED on Vivo X70 Pro version 12 running Bravemonoarm64.apk_1.52.72 and Bravemonoarm64.apk_1.51.105

Verified the test plan from brave/brave-core#17431 and ensured that there is no crash when Nightly widget is added to the home screen

vidma_recorder_27042023_104056.mp4

@GeetaSarvadnya GeetaSarvadnya added QA Pass - Android ARM and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash OS/Android Fixes related to Android browser functionality priority/P2 A bad problem. We might uplift this to the next planned release. QA Pass - Android ARM QA/Yes release-notes/include
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants