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

Fix: Window.FEATURE_NO_TITLE does not work when using activity traces #1769

Merged
merged 5 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* Fix: Window.FEATURE_NO_TITLE does not work when using activity traces (#1769)
* Fix: unregister UncaughtExceptionHandler on close (#1770)

## 5.2.3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ private void finishTransaction(final @Nullable ITransaction transaction) {
@Override
public synchronized void onActivityCreated(
final @NonNull Activity activity, final @Nullable Bundle savedInstanceState) {
activityFramesTracker.addActivity(activity);
setColdStart(savedInstanceState);
addBreadcrumb(activity, "created");
startTracing(activity);
Expand All @@ -237,6 +236,13 @@ public synchronized void onActivityCreated(

@Override
public synchronized void onActivityStarted(final @NonNull Activity activity) {
// The docs on the screen rendering performance tracing
// (https://firebase.google.com/docs/perf-mon/screen-traces?platform=android#definition),
// state that the tracing starts for every Activity class when the app calls .onActivityStarted.
// Adding an Activity in onActivityCreated leads to Window.FEATURE_NO_TITLE not
// working. Moving this to onActivityStarted fixes the problem.
activityFramesTracker.addActivity(activity);

addBreadcrumb(activity, "started");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class ActivityLifecycleIntegrationTest {
sut.register(fixture.hub, fixture.options)

val activity = mock<Activity>()
sut.onActivityCreated(activity, fixture.bundle)
sut.onActivityStarted(activity)

verify(fixture.activityFramesTracker).addActivity(eq(activity))
}
Expand Down