-
Notifications
You must be signed in to change notification settings - Fork 925
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
Fixes a crash on calling TemplateUrlServiceFactory when main Activity is stopping #21328
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,7 @@ | |
import org.chromium.chrome.browser.tab.TabLaunchType; | ||
import org.chromium.chrome.browser.tab.TabSelectionType; | ||
import org.chromium.chrome.browser.tabmodel.TabModel; | ||
import org.chromium.chrome.browser.tabmodel.TabModelSelector; | ||
import org.chromium.chrome.browser.tabmodel.TabModelUtils; | ||
import org.chromium.chrome.browser.toolbar.bottom.BottomToolbarConfiguration; | ||
import org.chromium.chrome.browser.toolbar.top.BraveToolbarLayoutImpl; | ||
|
@@ -306,12 +307,6 @@ public void onResumeWithNative() { | |
BraveVpnNativeWorker.getInstance().addObserver(this); | ||
BraveVpnUtils.reportBackgroundUsageP3A(); | ||
} | ||
Profile profile = getCurrentTabModel().getProfile(); | ||
if (profile != null) { | ||
// Set proper active DSE whenever brave returns to foreground. | ||
// If active tab is private, set private DSE as an active DSE. | ||
BraveSearchEngineUtils.updateActiveDSE(profile); | ||
} | ||
|
||
// The check on mNativeInitialized is mostly to ensure that mojo | ||
// services for wallet are initialized. | ||
|
@@ -342,12 +337,6 @@ public void onPauseWithNative() { | |
if (BraveVpnUtils.isVpnFeatureSupported(BraveActivity.this)) { | ||
BraveVpnNativeWorker.getInstance().removeObserver(this); | ||
} | ||
Profile profile = getCurrentTabModel().getProfile(); | ||
if (profile != null && profile.isOffTheRecord()) { | ||
// Set normal DSE as an active DSE when brave goes in background | ||
// because currently set DSE is used by outside of brave(ex, brave search widget). | ||
BraveSearchEngineUtils.updateActiveDSE(profile); | ||
} | ||
super.onPauseWithNative(); | ||
} | ||
|
||
|
@@ -803,7 +792,6 @@ public void initializeState() { | |
setLoadedFeed(false); | ||
setComesFromNewTab(false); | ||
setNewsItemsFeedCards(null); | ||
BraveSearchEngineUtils.initializeBraveSearchEngineStates(getTabModelSelector()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved it to |
||
Intent intent = getIntent(); | ||
if (intent != null && intent.getBooleanExtra(Utils.RESTART_WALLET_ACTIVITY, false)) { | ||
openBraveWallet(false, | ||
|
@@ -938,6 +926,8 @@ public void maybeSolveAdaptiveCaptcha() { | |
@Override | ||
public void finishNativeInitialization() { | ||
super.finishNativeInitialization(); | ||
BraveSearchEngineUtils.initializeBraveSearchEngineStates( | ||
(TabModelSelector) getTabModelSelectorSupplier().get()); | ||
BraveVpnNativeWorker.getInstance().reloadPurchasedState(); | ||
|
||
BraveHelper.maybeMigrateSettings(); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeyZhukovsky are we okay removing the change here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified such steps:
Do you have other steps or do you know why we added the above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see any reason why it's there, but I'll keep an eye what happens once the change hits users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you verify the change with
quick action search
widget we have ?Steps :
If above looks good, we are good to go ahead with the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screen_recording_20231211_152350.webm