Merge "Lazy load status icon related components" into rvc-dev am: 71f6afb212 am: c34ec33e1e

Change-Id: I02b7f79a0fa107b82e9887ec11f34532222d3553
This commit is contained in:
Heemin Seog
2020-04-29 18:36:21 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 9 deletions

View File

@@ -78,8 +78,8 @@ public class CarNavigationBar extends SystemUI implements CommandQueue.Callbacks
private final IStatusBarService mBarService; private final IStatusBarService mBarService;
private final Lazy<KeyguardStateController> mKeyguardStateControllerLazy; private final Lazy<KeyguardStateController> mKeyguardStateControllerLazy;
private final ButtonSelectionStateController mButtonSelectionStateController; private final ButtonSelectionStateController mButtonSelectionStateController;
private final PhoneStatusBarPolicy mIconPolicy; private final Lazy<PhoneStatusBarPolicy> mIconPolicyLazy;
private final StatusBarIconController mIconController; private final Lazy<StatusBarIconController> mIconControllerLazy;
private final int mDisplayId; private final int mDisplayId;
@@ -124,8 +124,8 @@ public class CarNavigationBar extends SystemUI implements CommandQueue.Callbacks
IStatusBarService barService, IStatusBarService barService,
Lazy<KeyguardStateController> keyguardStateControllerLazy, Lazy<KeyguardStateController> keyguardStateControllerLazy,
ButtonSelectionStateController buttonSelectionStateController, ButtonSelectionStateController buttonSelectionStateController,
PhoneStatusBarPolicy iconPolicy, Lazy<PhoneStatusBarPolicy> iconPolicyLazy,
StatusBarIconController iconController Lazy<StatusBarIconController> iconControllerLazy
) { ) {
super(context); super(context);
mResources = resources; mResources = resources;
@@ -140,8 +140,8 @@ public class CarNavigationBar extends SystemUI implements CommandQueue.Callbacks
mBarService = barService; mBarService = barService;
mKeyguardStateControllerLazy = keyguardStateControllerLazy; mKeyguardStateControllerLazy = keyguardStateControllerLazy;
mButtonSelectionStateController = buttonSelectionStateController; mButtonSelectionStateController = buttonSelectionStateController;
mIconPolicy = iconPolicy; mIconPolicyLazy = iconPolicyLazy;
mIconController = iconController; mIconControllerLazy = iconControllerLazy;
mDisplayId = context.getDisplayId(); mDisplayId = context.getDisplayId();
} }
@@ -238,8 +238,8 @@ public class CarNavigationBar extends SystemUI implements CommandQueue.Callbacks
// Must be called on the main thread due to the use of observeForever() in // Must be called on the main thread due to the use of observeForever() in
// mIconPolicy.init(). // mIconPolicy.init().
mMainHandler.post(() -> { mMainHandler.post(() -> {
mIconPolicy.init(); mIconPolicyLazy.get().init();
mSignalPolicy = new StatusBarSignalPolicy(mContext, mIconController); mSignalPolicy = new StatusBarSignalPolicy(mContext, mIconControllerLazy.get());
}); });
} }

View File

@@ -91,7 +91,7 @@ public class CarNavigationBarTest extends SysuiTestCase {
mCarNavigationBarController, mWindowManager, mDeviceProvisionedController, mCarNavigationBarController, mWindowManager, mDeviceProvisionedController,
new CommandQueue(mContext), mAutoHideController, mButtonSelectionStateListener, new CommandQueue(mContext), mAutoHideController, mButtonSelectionStateListener,
mHandler, mBackgroundHandler, mBarService, () -> mKeyguardStateController, mHandler, mBackgroundHandler, mBarService, () -> mKeyguardStateController,
mButtonSelectionStateController, mIconPolicy, mIconController); mButtonSelectionStateController, () -> mIconPolicy, () -> mIconController);
} }
@Test @Test