Skip to content

Commit

Permalink
Fix: Window.FEATURE_NO_TITLE does not work when using activity traces (
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Oct 18, 2021
1 parent a001bbf commit d9cd9f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
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

0 comments on commit d9cd9f8

Please sign in to comment.