Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +3 −14 Original line number Diff line number Diff line Loading @@ -49,9 +49,6 @@ import com.android.systemui.animation.Interpolators; import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver; import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.phone.StatusBarIconController.TintedIconManager; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener; import com.android.systemui.statusbar.policy.UserInfoControllerImpl; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -61,8 +58,7 @@ import java.util.List; /** * The header group on Keyguard. */ public class KeyguardStatusBarView extends RelativeLayout implements OnUserInfoChangedListener { public class KeyguardStatusBarView extends RelativeLayout { private static final int LAYOUT_NONE = 0; private static final int LAYOUT_CUTOUT = 1; Loading Loading @@ -334,9 +330,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); UserInfoController userInfoController = Dependency.get(UserInfoController.class); userInfoController.addCallback(this); userInfoController.reloadUserInfo(); mIconManager = new TintedIconManager(findViewById(R.id.statusIcons), mFeatureFlags); mIconManager.setBlockList(mBlockedIcons); Dependency.get(StatusBarIconController.class).addIconGroup(mIconManager); Loading @@ -345,12 +338,11 @@ public class KeyguardStatusBarView extends RelativeLayout implements @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); Dependency.get(UserInfoController.class).removeCallback(this); Dependency.get(StatusBarIconController.class).removeIconGroup(mIconManager); } @Override public void onUserInfoChanged(String name, Drawable picture, String userAccount) { /** Should only be called from {@link KeyguardStatusBarViewController}. */ void onUserInfoChanged(Drawable picture) { mMultiUserAvatar.setImageDrawable(picture); } Loading Loading @@ -432,9 +424,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements void onThemeChanged() { mBatteryView.setColorsFromContext(mContext); updateIconsAndTextColors(); // Reload user avatar ((UserInfoControllerImpl) Dependency.get(UserInfoController.class)) .onDensityOrFontScaleChanged(); } /** Should only be called from {@link KeyguardStatusBarViewController}. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +10 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.statusbar.events.SystemStatusAnimationCallback; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.util.ViewController; import java.io.FileDescriptor; Loading @@ -41,6 +42,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat private final ConfigurationController mConfigurationController; private final SystemStatusAnimationScheduler mAnimationScheduler; private final BatteryController mBatteryController; private final UserInfoController mUserInfoController; private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { Loading Loading @@ -89,6 +91,9 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat } }; private final UserInfoController.OnUserInfoChangedListener mOnUserInfoChangedListener = (name, picture, userAccount) -> mView.onUserInfoChanged(picture); private boolean mBatteryListening; @Inject Loading @@ -97,12 +102,14 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat CarrierTextController carrierTextController, ConfigurationController configurationController, SystemStatusAnimationScheduler animationScheduler, BatteryController batteryController) { BatteryController batteryController, UserInfoController userInfoController) { super(view); mCarrierTextController = carrierTextController; mConfigurationController = configurationController; mAnimationScheduler = animationScheduler; mBatteryController = batteryController; mUserInfoController = userInfoController; } @Override Loading @@ -115,6 +122,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat protected void onViewAttached() { mConfigurationController.addCallback(mConfigurationListener); mAnimationScheduler.addCallback(mAnimationCallback); mUserInfoController.addCallback(mOnUserInfoChangedListener); onThemeChanged(); } Loading @@ -122,6 +130,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat protected void onViewDetached() { mConfigurationController.removeCallback(mConfigurationListener); mAnimationScheduler.removeCallback(mAnimationCallback); mUserInfoController.removeCallback(mOnUserInfoChangedListener); } /** Should be called when the theme changes. */ Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.UserInfoController; import org.junit.Before; import org.junit.Test; Loading @@ -45,6 +46,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { private SystemStatusAnimationScheduler mAnimationScheduler; @Mock private BatteryController mBatteryController; @Mock private UserInfoController mUserInfoController; private KeyguardStatusBarViewController mController; Loading @@ -57,7 +60,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mCarrierTextController, mConfigurationController, mAnimationScheduler, mBatteryController mBatteryController, mUserInfoController ); } Loading @@ -67,6 +71,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { verify(mConfigurationController).addCallback(any()); verify(mAnimationScheduler).addCallback(any()); verify(mUserInfoController).addCallback(any()); } @Test Loading @@ -75,6 +80,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { verify(mConfigurationController).removeCallback(any()); verify(mAnimationScheduler).removeCallback(any()); verify(mUserInfoController).removeCallback(any()); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +3 −14 Original line number Diff line number Diff line Loading @@ -49,9 +49,6 @@ import com.android.systemui.animation.Interpolators; import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver; import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.phone.StatusBarIconController.TintedIconManager; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChangedListener; import com.android.systemui.statusbar.policy.UserInfoControllerImpl; import java.io.FileDescriptor; import java.io.PrintWriter; Loading @@ -61,8 +58,7 @@ import java.util.List; /** * The header group on Keyguard. */ public class KeyguardStatusBarView extends RelativeLayout implements OnUserInfoChangedListener { public class KeyguardStatusBarView extends RelativeLayout { private static final int LAYOUT_NONE = 0; private static final int LAYOUT_CUTOUT = 1; Loading Loading @@ -334,9 +330,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); UserInfoController userInfoController = Dependency.get(UserInfoController.class); userInfoController.addCallback(this); userInfoController.reloadUserInfo(); mIconManager = new TintedIconManager(findViewById(R.id.statusIcons), mFeatureFlags); mIconManager.setBlockList(mBlockedIcons); Dependency.get(StatusBarIconController.class).addIconGroup(mIconManager); Loading @@ -345,12 +338,11 @@ public class KeyguardStatusBarView extends RelativeLayout implements @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); Dependency.get(UserInfoController.class).removeCallback(this); Dependency.get(StatusBarIconController.class).removeIconGroup(mIconManager); } @Override public void onUserInfoChanged(String name, Drawable picture, String userAccount) { /** Should only be called from {@link KeyguardStatusBarViewController}. */ void onUserInfoChanged(Drawable picture) { mMultiUserAvatar.setImageDrawable(picture); } Loading Loading @@ -432,9 +424,6 @@ public class KeyguardStatusBarView extends RelativeLayout implements void onThemeChanged() { mBatteryView.setColorsFromContext(mContext); updateIconsAndTextColors(); // Reload user avatar ((UserInfoControllerImpl) Dependency.get(UserInfoController.class)) .onDensityOrFontScaleChanged(); } /** Should only be called from {@link KeyguardStatusBarViewController}. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java +10 −1 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import com.android.systemui.statusbar.events.SystemStatusAnimationCallback; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.util.ViewController; import java.io.FileDescriptor; Loading @@ -41,6 +42,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat private final ConfigurationController mConfigurationController; private final SystemStatusAnimationScheduler mAnimationScheduler; private final BatteryController mBatteryController; private final UserInfoController mUserInfoController; private final ConfigurationController.ConfigurationListener mConfigurationListener = new ConfigurationController.ConfigurationListener() { Loading Loading @@ -89,6 +91,9 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat } }; private final UserInfoController.OnUserInfoChangedListener mOnUserInfoChangedListener = (name, picture, userAccount) -> mView.onUserInfoChanged(picture); private boolean mBatteryListening; @Inject Loading @@ -97,12 +102,14 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat CarrierTextController carrierTextController, ConfigurationController configurationController, SystemStatusAnimationScheduler animationScheduler, BatteryController batteryController) { BatteryController batteryController, UserInfoController userInfoController) { super(view); mCarrierTextController = carrierTextController; mConfigurationController = configurationController; mAnimationScheduler = animationScheduler; mBatteryController = batteryController; mUserInfoController = userInfoController; } @Override Loading @@ -115,6 +122,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat protected void onViewAttached() { mConfigurationController.addCallback(mConfigurationListener); mAnimationScheduler.addCallback(mAnimationCallback); mUserInfoController.addCallback(mOnUserInfoChangedListener); onThemeChanged(); } Loading @@ -122,6 +130,7 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat protected void onViewDetached() { mConfigurationController.removeCallback(mConfigurationListener); mAnimationScheduler.removeCallback(mAnimationCallback); mUserInfoController.removeCallback(mOnUserInfoChangedListener); } /** Should be called when the theme changes. */ Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java +7 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.systemui.SysuiTestCase; import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.UserInfoController; import org.junit.Before; import org.junit.Test; Loading @@ -45,6 +46,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { private SystemStatusAnimationScheduler mAnimationScheduler; @Mock private BatteryController mBatteryController; @Mock private UserInfoController mUserInfoController; private KeyguardStatusBarViewController mController; Loading @@ -57,7 +60,8 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { mCarrierTextController, mConfigurationController, mAnimationScheduler, mBatteryController mBatteryController, mUserInfoController ); } Loading @@ -67,6 +71,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { verify(mConfigurationController).addCallback(any()); verify(mAnimationScheduler).addCallback(any()); verify(mUserInfoController).addCallback(any()); } @Test Loading @@ -75,6 +80,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase { verify(mConfigurationController).removeCallback(any()); verify(mAnimationScheduler).removeCallback(any()); verify(mUserInfoController).removeCallback(any()); } @Test Loading