Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +1 −1 Original line number Diff line number Diff line Loading @@ -342,7 +342,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } void refreshFormat(String timeFormat) { void refreshFormat() { if (mClockViewController != null) { mClockViewController.refreshFormat(); mLargeClockViewController.refreshFormat(); Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,11 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV refreshTime(); } @Override public void onTimeFormatChanged(String timeFormat) { mKeyguardClockSwitchController.refreshFormat(); } @Override public void onTimeZoneChanged(TimeZone timeZone) { mKeyguardClockSwitchController.updateTimeZone(timeZone); Loading Loading @@ -313,6 +318,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV @Override public void onUserSwitchComplete(int userId) { mKeyguardClockSwitchController.refreshFormat(); mView.updateOwnerInfo(); mView.updateLogoutView(shouldShowLogout()); } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; Loading Loading @@ -59,6 +61,8 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { SmartspaceTransitionController mSmartSpaceTransitionController; @Mock UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Captor private ArgumentCaptor<KeyguardUpdateMonitorCallback> mKeyguardUpdateMonitorCallbackCaptor; private KeyguardStatusViewController mController; Loading Loading @@ -90,4 +94,26 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { mController.dozeTimeTick(); verify(mKeyguardClockSwitchController).refresh(); } @Test public void timeFormatUpdateNotifiesClockSwitchController() { mController.onViewAttached(); verify(mKeyguardUpdateMonitor).registerCallback( mKeyguardUpdateMonitorCallbackCaptor.capture()); mKeyguardUpdateMonitorCallbackCaptor.getValue().onTimeFormatChanged(""); verify(mKeyguardClockSwitchController).refreshFormat(); } @Test public void userChangeNotifiesClockSwitchController() { mController.onViewAttached(); verify(mKeyguardUpdateMonitor).registerCallback( mKeyguardUpdateMonitorCallbackCaptor.capture()); mKeyguardUpdateMonitorCallbackCaptor.getValue().onUserSwitchComplete(0); verify(mKeyguardClockSwitchController).refreshFormat(); } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +1 −1 Original line number Diff line number Diff line Loading @@ -342,7 +342,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } void refreshFormat(String timeFormat) { void refreshFormat() { if (mClockViewController != null) { mClockViewController.refreshFormat(); mLargeClockViewController.refreshFormat(); Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +6 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,11 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV refreshTime(); } @Override public void onTimeFormatChanged(String timeFormat) { mKeyguardClockSwitchController.refreshFormat(); } @Override public void onTimeZoneChanged(TimeZone timeZone) { mKeyguardClockSwitchController.updateTimeZone(timeZone); Loading Loading @@ -313,6 +318,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV @Override public void onUserSwitchComplete(int userId) { mKeyguardClockSwitchController.refreshFormat(); mView.updateOwnerInfo(); mView.updateLogoutView(shouldShowLogout()); } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewControllerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; Loading Loading @@ -59,6 +61,8 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { SmartspaceTransitionController mSmartSpaceTransitionController; @Mock UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Captor private ArgumentCaptor<KeyguardUpdateMonitorCallback> mKeyguardUpdateMonitorCallbackCaptor; private KeyguardStatusViewController mController; Loading Loading @@ -90,4 +94,26 @@ public class KeyguardStatusViewControllerTest extends SysuiTestCase { mController.dozeTimeTick(); verify(mKeyguardClockSwitchController).refresh(); } @Test public void timeFormatUpdateNotifiesClockSwitchController() { mController.onViewAttached(); verify(mKeyguardUpdateMonitor).registerCallback( mKeyguardUpdateMonitorCallbackCaptor.capture()); mKeyguardUpdateMonitorCallbackCaptor.getValue().onTimeFormatChanged(""); verify(mKeyguardClockSwitchController).refreshFormat(); } @Test public void userChangeNotifiesClockSwitchController() { mController.onViewAttached(); verify(mKeyguardUpdateMonitor).registerCallback( mKeyguardUpdateMonitorCallbackCaptor.capture()); mKeyguardUpdateMonitorCallbackCaptor.getValue().onUserSwitchComplete(0); verify(mKeyguardClockSwitchController).refreshFormat(); } }