settings: Fix finishCurrentSettings() for Android settings in tab [chromium/src : main]

0 views
Skip to first unread message

James Cook (Gerrit)

unread,
Jul 8, 2026, 10:41:08 PM (13 hours ago) Jul 8
to Jinsuk Kim, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from Jinsuk Kim

James Cook added 2 comments

Patchset-level comments
File-level comment, Patchset 1 (Latest):
James Cook . resolved

Jinsuk, please take a look. Thanks!

File chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsNavigationImpl.java
Line 456, Patchset 1 (Latest): ((SettingsActivity) activity).finishCurrentSettings(fragment);
James Cook . unresolved

FYI - This was the line that was crashing, with ClassCastException.

Open in Gerrit

Related details

Attention is currently required from:
  • Jinsuk Kim
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic4cc8e532929a89ee98ffbbcba78bc53fd18b926
Gerrit-Change-Number: 8067521
Gerrit-PatchSet: 1
Gerrit-Owner: James Cook <jame...@chromium.org>
Gerrit-Reviewer: James Cook <jame...@chromium.org>
Gerrit-Reviewer: Jinsuk Kim <jins...@chromium.org>
Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
Gerrit-Attention: Jinsuk Kim <jins...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Jul 2026 02:40:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Jinsuk Kim (Gerrit)

unread,
8:08 AM (3 hours ago) 8:08 AM
to James Cook, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from James Cook

Jinsuk Kim added 3 comments

File chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsHostFragment.java
Line 55, Patchset 1 (Latest): // If we have pending back entries, show the correct fragment. This can happen when a
Jinsuk Kim . unresolved

Would you check one scenario for this new logic?

1) Enter multi-column settings after signed in.
2) Tap account entry in main settings to show 'Account' in the right pane
3) Tap 'sign out' at the bottom of the right pane

This makes settings (in SettingsActivity) exit, which is not desirable but inevitable, due to finishCurrentSettings called with an empty back stack. I *think* this new logic makes the settings tab stay with the invalidated account subsettings.

File chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsNavigationImpl.java
Line 456, Patchset 1 (Latest): ((SettingsActivity) activity).finishCurrentSettings(fragment);
James Cook . resolved

FYI - This was the line that was crashing, with ClassCastException.

Jinsuk Kim

Acknowledged.

How do you feel about extending this class to have its own impl for settings in a tab, as more methods are being overridden? Maybe a TODO if that makes sense to you.

File chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsPageFragmentDelegateImpl.java
Line 315, Patchset 1 (Latest): if (mSettingsHostFragment != null && mSettingsHostFragment.isAttachedToActivity()) {
Jinsuk Kim . unresolved

Please add a log or use asserts to see if this is called when the fragment is null or in detached state.

Open in Gerrit

Related details

Attention is currently required from:
  • James Cook
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic4cc8e532929a89ee98ffbbcba78bc53fd18b926
Gerrit-Change-Number: 8067521
Gerrit-PatchSet: 1
Gerrit-Owner: James Cook <jame...@chromium.org>
Gerrit-Reviewer: James Cook <jame...@chromium.org>
Gerrit-Reviewer: Jinsuk Kim <jins...@chromium.org>
Gerrit-CC: Achuith Bhandarkar <ach...@chromium.org>
Gerrit-Attention: James Cook <jame...@chromium.org>
Gerrit-Comment-Date: Thu, 09 Jul 2026 12:08:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: James Cook <jame...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Jinsuk Kim (Gerrit)

unread,
8:26 AM (3 hours ago) 8:26 AM
to James Cook, Achuith Bhandarkar, Chromium LUCI CQ, chromium...@chromium.org
Attention needed from James Cook

Jinsuk Kim added 1 comment

File chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsHostFragment.java
Line 55, Patchset 1 (Latest): // If we have pending back entries, show the correct fragment. This can happen when a
Jinsuk Kim . unresolved

Would you check one scenario for this new logic?

1) Enter multi-column settings after signed in.
2) Tap account entry in main settings to show 'Account' in the right pane
3) Tap 'sign out' at the bottom of the right pane

This makes settings (in SettingsActivity) exit, which is not desirable but inevitable, due to finishCurrentSettings called with an empty back stack. I *think* this new logic makes the settings tab stay with the invalidated account subsettings.

Gerrit-Comment-Date: Thu, 09 Jul 2026 12:25:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Jinsuk Kim <jins...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages