Merge "Update smartspace when clock updates." into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-17 22:36:27 +00:00
committed by Android (Google) Code Review
3 changed files with 14 additions and 0 deletions

View File

@@ -259,6 +259,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mClockViewController.refreshTime();
mLargeClockViewController.refreshTime();
}
if (mSmartspaceController != null) {
mSmartspaceController.requestSmartspaceUpdate();
}
mView.refresh();
}

View File

@@ -106,6 +106,10 @@ class LockscreenSmartspaceController @Inject constructor(
return view
}
fun requestSmartspaceUpdate() {
session?.requestSmartspaceUpdate()
}
private fun buildView(parent: ViewGroup) {
if (plugin == null) {
return

View File

@@ -232,6 +232,13 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
verify(mView).removeView(mFakeSmartspaceView);
}
@Test
public void testRefresh() {
mController.refresh();
verify(mSmartspaceController).requestSmartspaceUpdate();
}
private void verifyAttachment(VerificationMode times) {
verify(mClockManager, times).addOnClockChangedListener(
any(ClockManager.ClockChangedListener.class));