Commit Graph

3 Commits

Author SHA1 Message Date
Anushree Ganjam
26a5f65afd Make sandboxContext extend LauncherApplication (4/n)
See
https://docs.google.com/drawings/d/1JHFi_nhmQt2xPT1N3FB_1mnaRK5TVqKZ9-fSl3EA7sU/edit?usp=sharing
and
https://docs.google.com/drawings/d/1bx4WURP4uHZGzZ1bWQgpw701jkTkVqlNfA02Yt-ZtSI/edit?usp=sharing&resourcekey=0-oySjsnaCsOSrNIPqqEa0gw
for design details.

We need to make SandboxContext extend LauncherApplication because we
want create MainThreadInitializedObjects in SandboxContext's
AppComponent scope. Since MainThreadInitiliazedObjects are closed in
SandboxContext's OnDestroy() , we need to replicate same thing using
dagger as well.

- DaggerSingletonObject is same as MainThreadInitializedObject but is
  used for fetching the dagger created singletons so that we can avoid
  major refactors for accessing singletons. This will be deleted soon.

- DaggerSingletonTracker to track dagger created singletons and call
  close() on those singleton objects created in SandboxContext scope.

- Annotate the singleton object SettingsChangeLogger constructor with @Inject and execute the statements in Main thread.
- Added createSandboxContextForTest(only for Test) to avoid creation of
  dagger component in test. As follow up, I will delete this method and
  introduce fakeDaggerComponents in test.

Bug: 361850561
Test: Manual
Flag: NONE Dagger Integration

Change-Id: I2d3762ea64e53baa4de190790568aec750b54201
2024-09-19 11:20:30 -07:00
Anushree Ganjam
fbc0f97410 Add LauncherAppSingleton & LauncherActivityScope to dagger graph (3/n)
* Add ApplicationContext qualifier and binding the application context instance so
that this context is available across dagger graph.

* Add QuickStepModule and LoggingModule
* Provide SettingsChangeLogger in dagger way. We are depending on
  MainThreadInitializedObject for cleanup. We need to define a way
  explicitly see how we can destroy singleton objects.

Bug: 361850561
Test: Manual
Flag: NONE Dagger Integration
Change-Id: Ia10cc500edb1d88adcca540119651f59b9bc8dc8
2024-09-11 13:56:23 -07:00
Anushree Ganjam
14721d1e3a Dagger codeswap setup between Quickstep and NexusLauncher (2/n)
Bug: 361850561
Test: Manual
Flag: NONE Dagger Integration
Change-Id: Ic552091d91b991b2fdaf5c3eaa73f394328889e3
2024-08-29 10:05:12 -07:00