Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit bedb8136 authored by Ats Jenk's avatar Ats Jenk
Browse files

Only create DesktopModeController when flag is on

Ensure that DesktopModeController and DesktopModeTaskRepository are only
created when they are needed, when the desktop mode flag is on.
With the previous dagger configuration WMShellBaseModule relied on
submodules to provide an implementation if one exists.
If the submodule does have the implementation defined, it is always created and
supplied to WMShellBaseModule provider method.
Provider method in WMShellBaseModule then decides, based on flags,
whether to return that implementation or not. But the instance is always
created, regardless of that flag check.

This change ensures that DesktopModeController and
DesktopModeTaskRepository are only instantiated if WMShellBaseModule
provider methods will provide a corresponding instance. This is achieved
by relying on lazy instance creation by dagger.
If the instances won't be provided due to flags being off, the instances won't be
created.

Bug: 260908558
Test: build and run sysui with desktop mode flag off, observe
DesktopModeController object is not instatiated

Change-Id: Ia155b8e079072e543c98463a58ab1907729db7b0
parent dae823a3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment