-
Notifications
You must be signed in to change notification settings - Fork 681
Fireperf aqs sessionmanager phase2 #7997
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
base: fireperf-aqs
Are you sure you want to change the base?
Changes from all commits
41775c1
63f7df9
f6d0cac
5dc07fa
b9e986a
2b7a782
6a84a79
19f2d65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,12 +168,15 @@ public static void setLauncherActivityOnResumeTime(String activity) { | |
| } | ||
|
|
||
| public static AppStartTrace getInstance(SessionManager sessionManager) { | ||
| return instance != null ? instance : getInstance(TransportManager.getInstance(), new Clock(), sessionManager); | ||
| return instance != null | ||
| ? instance | ||
| : getInstance(TransportManager.getInstance(), new Clock(), sessionManager); | ||
| } | ||
|
|
||
| // TODO(b/258263016): Migrate to go/firebase-android-executors | ||
| @SuppressLint("ThreadPoolCreation") | ||
| static AppStartTrace getInstance(TransportManager transportManager, Clock clock, SessionManager sessionManager) { | ||
| static AppStartTrace getInstance( | ||
| TransportManager transportManager, Clock clock, SessionManager sessionManager) { | ||
| if (instance == null) { | ||
| synchronized (AppStartTrace.class) { | ||
| if (instance == null) { | ||
|
|
@@ -564,11 +567,6 @@ public static boolean isAnyAppProcessInForeground(Context appContext) { | |
| if (appProcess.importance != ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) { | ||
| continue; | ||
| } | ||
| // if (appProcess.processName.equals(appProcessName) | ||
|
Contributor
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'm guessing I might've accidentally commented this out in Can you uncomment it?
Contributor
Author
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. Fix applied: Removed the dead-comment block — the variables it referenced ( |
||
| // || appProcess.processName.startsWith(allowedAppProcessNamePrefix)) { | ||
| // // Returns true if the process with `IMPORTANCE_FOREGROUND` matches current process. | ||
| // return true; | ||
| // } | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
Is there a way to use the
getInstance()method instead of passing in thesessionManageras a parameter?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.
Keeping the seeded overload intentionally — both methods are designed to coexist.
The no-arg
getInstance()(line 95) is the fallback for call sites after early init (e.g.AppStateUpdateHandler, tests).The seeded
getInstance(SessionManager)is the DI injection point used byFirebasePerfEarlyto propagate the Dagger-managed instance at startup. Replacing it with the no-arg form would mean constructing a throwawaySessionManagerinternally instead of the one supplied by the container, which defeats the purpose of this migration.