Skip to content

Commit

Permalink
[M106][Android] Use CrashKeyString to tag FRE crashes
Browse files Browse the repository at this point in the history
If Chrome is started and the FRE is not completed yet - tag crashes
happening in this session with "first_run": "yes". This is consistent
with iOS, where crashes from the first run are tagged with
"first-run": "yes". This information is helpful to analyze stability
of FRE-related launches and should give us more info about the flow
that led to a crash.

(cherry picked from commit da740b4)

Bug: 1354558
Change-Id: Ia37f322f4b01d9b4e4bef34765c221bba96cf5bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3841762
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Reviewed-by: Sam Maier <smaier@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1037752}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3851321
Auto-Submit: Boris Sazonov <bsazonov@chromium.org>
Commit-Queue: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/branch-heads/5249@{#44}
Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
  • Loading branch information
Boris Sazonov authored and Chromium LUCI CQ committed Aug 23, 2022
1 parent 10208c7 commit 436c398
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
import org.chromium.chrome.browser.signin.services.SigninManager;
import org.chromium.chrome.browser.vr.VrModuleProvider;
import org.chromium.components.crash.CrashKeyIndex;
import org.chromium.components.crash.CrashKeys;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.components.signin.AccountManagerFacadeProvider;
import org.chromium.components.signin.identitymanager.ConsentLevel;
Expand Down Expand Up @@ -282,6 +284,7 @@ public static boolean launch(Context caller, Intent fromIntent, boolean requires
}

Log.d(TAG, "Redirecting user through FRE.");
CrashKeys.getInstance().set(CrashKeyIndex.FIRST_RUN, "yes");

// Launch the async restriction checking as soon as we know we'll be running FRE.
FirstRunAppRestrictionInfo.startInitializationHint();
Expand Down
1 change: 1 addition & 0 deletions components/crash/android/crash_keys_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ JavaCrashKey& GetCrashKey(int index) {
{"emulated_modules", JavaCrashKey::Tag::kArray},
{"dynamic_module_dex_name", JavaCrashKey::Tag::kArray},
{"partner_customization_config", JavaCrashKey::Tag::kArray},
{"first_run", JavaCrashKey::Tag::kArray},
};
static_assert(
std::size(crash_keys) == static_cast<size_t>(CrashKeyIndex::NUM_ENTRIES),
Expand Down
1 change: 1 addition & 0 deletions components/crash/android/crash_keys_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum class CrashKeyIndex {
EMULATED_MODULES,
DYNAMIC_MODULE_DEX_NAME,
PARTNER_CUSTOMIZATION_CONFIG,
FIRST_RUN,
NUM_ENTRIES
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class CrashKeys {
private static final String[] KEYS = new String[] {"loaded_dynamic_module",
"active_dynamic_module", "application_status", "installed_modules", "emulated_modules",
"dynamic_module_dex_name", "partner_customization_config"};
"dynamic_module_dex_name", "partner_customization_config", "first_run"};

private final AtomicReferenceArray<String> mValues = new AtomicReferenceArray<>(KEYS.length);

Expand Down

0 comments on commit 436c398

Please sign in to comment.