Commit 78ea6a26 authored by Hazem Ashmawy's avatar Hazem Ashmawy Committed by Commit Bot

[AW][Dev-UI] start activity using MainActivity context

Use MainActivity context to startActivity instead of calling the
fragment#startActivity to avoid the exception thrown when the fragment
is detached.

Bug: 1130732
Test: Manually launch the app, click settings
Test: run_webview_instrumentation_test_apk -f "*android_webview.devui*"
Change-Id: Ib43df575edf34154b4297fac2bc1b8216250cdae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424151
Commit-Queue: Hazem Ashmawy <hazems@chromium.org>
Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810295}
parent 91432c22
......@@ -503,7 +503,8 @@ public class CrashesListFragment extends DevUiBaseFragment {
// Show a button to open GMS settings activity only if it exists.
if (intentResolveInfo.size() > 0) {
logCrashCollectionState(CollectionState.DISABLED_BY_USER_CONSENT);
errorView.setActionButton("Open Settings", v -> startActivity(settingsIntent));
errorView.setActionButton(
"Open Settings", v -> mContext.startActivity(settingsIntent));
} else {
logCrashCollectionState(
CollectionState.DISABLED_BY_USER_CONSENT_CANNOT_FIND_SETTINGS);
......@@ -520,7 +521,7 @@ public class CrashesListFragment extends DevUiBaseFragment {
dialogBuilder.setMessage(CRASH_BUG_DIALOG_MESSAGE);
dialogBuilder.setPositiveButton("Provide more info", (dialog, id) -> {
logCrashInteraction(CrashInteraction.FILE_BUG_REPORT_DIALOG_PROCEED);
startActivity(new CrashBugUrlFactory(crashInfo).getReportIntent());
mContext.startActivity(new CrashBugUrlFactory(crashInfo).getReportIntent());
});
dialogBuilder.setNegativeButton("Dismiss", (dialog, id) -> {
logCrashInteraction(CrashInteraction.FILE_BUG_REPORT_DIALOG_DISMISS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment