Merge "Update smartspace when clock updates." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
07791ca5bb
@@ -259,6 +259,9 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
mClockViewController.refreshTime();
|
mClockViewController.refreshTime();
|
||||||
mLargeClockViewController.refreshTime();
|
mLargeClockViewController.refreshTime();
|
||||||
}
|
}
|
||||||
|
if (mSmartspaceController != null) {
|
||||||
|
mSmartspaceController.requestSmartspaceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
mView.refresh();
|
mView.refresh();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ class LockscreenSmartspaceController @Inject constructor(
|
|||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun requestSmartspaceUpdate() {
|
||||||
|
session?.requestSmartspaceUpdate()
|
||||||
|
}
|
||||||
|
|
||||||
private fun buildView(parent: ViewGroup) {
|
private fun buildView(parent: ViewGroup) {
|
||||||
if (plugin == null) {
|
if (plugin == null) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -232,6 +232,13 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase {
|
|||||||
verify(mView).removeView(mFakeSmartspaceView);
|
verify(mView).removeView(mFakeSmartspaceView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRefresh() {
|
||||||
|
mController.refresh();
|
||||||
|
|
||||||
|
verify(mSmartspaceController).requestSmartspaceUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
private void verifyAttachment(VerificationMode times) {
|
private void verifyAttachment(VerificationMode times) {
|
||||||
verify(mClockManager, times).addOnClockChangedListener(
|
verify(mClockManager, times).addOnClockChangedListener(
|
||||||
any(ClockManager.ClockChangedListener.class));
|
any(ClockManager.ClockChangedListener.class));
|
||||||
|
|||||||
Reference in New Issue
Block a user