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

Commit 61f6bdeb authored by Yifei Zhang's avatar Yifei Zhang
Browse files

wmshell: use Lazy<> for CompatUI dependencies

- Otherwise constructors of these dependencies will still be called when
  disabled.

Test: build & verify in method trace
Bug: 311023764
Change-Id: Icf8dc17c219884b5c7d16ab77db4e5c20681d625
parent 9251a7af
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -250,10 +250,10 @@ public abstract class WMShellBaseModule {
            SyncTransactionQueue syncQueue,
            @ShellMainThread ShellExecutor mainExecutor,
            Lazy<Transitions> transitionsLazy,
            DockStateReader dockStateReader,
            CompatUIConfiguration compatUIConfiguration,
            CompatUIShellCommandHandler compatUIShellCommandHandler,
            AccessibilityManager accessibilityManager) {
            Lazy<DockStateReader> dockStateReader,
            Lazy<CompatUIConfiguration> compatUIConfiguration,
            Lazy<CompatUIShellCommandHandler> compatUIShellCommandHandler,
            Lazy<AccessibilityManager> accessibilityManager) {
        if (!context.getResources().getBoolean(R.bool.config_enableCompatUIController)) {
            return Optional.empty();
        }
@@ -268,10 +268,10 @@ public abstract class WMShellBaseModule {
                        syncQueue,
                        mainExecutor,
                        transitionsLazy,
                        dockStateReader,
                        compatUIConfiguration,
                        compatUIShellCommandHandler,
                        accessibilityManager));
                        dockStateReader.get(),
                        compatUIConfiguration.get(),
                        compatUIShellCommandHandler.get(),
                        accessibilityManager.get()));
    }

    @WMSingleton