summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorShashwat Razdan <srazdan@google.com>2021-04-14 23:39:10 +0000
committerShashwat Razdan <srazdan@google.com>2021-04-20 08:06:25 +0000
commit8c63ca65814af72f660dcf84075aba68148c883e (patch)
tree4761e5f23d1dc4e561403f550c8f1ff0bb07f172 /packages/SystemUI/src
parentad6ad2644135478bf3de7f3335ac44e290d88b48 (diff)
Addressing the feedback received in the API review.
API Review bugs list is here: https://b.corp.google.com/issues?q=blockingid:176851064 Test: CTS tests: Fixes:185226923 Fixes:185226755 Fixes:185226674 Fixes:185226597 Fixes:185226790 Fixes:184585058 Fixes:184585080 Fixes:184585117 Fixes:184585343 Fixes:184585079 Change-Id: Idacee5f95ce104d1fb6de40a04ac2b74691f977e
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt4
2 files changed, 6 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index e7418e6a1619..96421f3a4981 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -86,7 +86,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private FrameLayout mLargeClockFrame;
private SmartspaceSession mSmartspaceSession;
- private SmartspaceSession.Callback mSmartspaceCallback;
+ private SmartspaceSession.OnTargetsAvailableListener mSmartspaceCallback;
private float mDozeAmount;
private int mWallpaperTextColor;
private int mDozeColor = Color.WHITE;
@@ -234,7 +234,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
.createSmartspaceSession(
new SmartspaceConfig.Builder(getContext(), "lockscreen").build());
mSmartspaceCallback = targets -> smartspaceDataPlugin.onTargetsAvailable(targets);
- mSmartspaceSession.registerSmartspaceUpdates(mUiExecutor, mSmartspaceCallback);
+ mSmartspaceSession.addOnTargetsAvailableListener(mUiExecutor, mSmartspaceCallback);
mSmartspaceSession.requestSmartspaceUpdate();
}
}
@@ -261,8 +261,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mView.setClockPlugin(null, mStatusBarStateController.getState());
if (mSmartspaceSession != null) {
- mSmartspaceSession.unregisterSmartspaceUpdates(mSmartspaceCallback);
- mSmartspaceSession.destroy();
+ mSmartspaceSession.removeOnTargetsAvailableListener(mSmartspaceCallback);
+ mSmartspaceSession.close();
mSmartspaceSession = null;
}
mStatusBarStateController.removeCallback(mStatusBarStateListener);
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index 574ce0dffee0..5ba04a03a8d5 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -227,7 +227,7 @@ class MediaDataManager(
smartspaceSession = smartspaceManager.createSmartspaceSession(
SmartspaceConfig.Builder(context, SMARTSPACE_UI_SURFACE_LABEL).build())
smartspaceSession?.let {
- it.registerSmartspaceUpdates(
+ it.addOnTargetsAvailableListener(
// Use a new thread listening to Smartspace updates instead of using the existing
// backgroundExecutor. SmartspaceSession has scheduled routine updates which can be
// unpredictable on test simulators, using the backgroundExecutor makes it's hard to
@@ -235,7 +235,7 @@ class MediaDataManager(
// Switch to use backgroundExecutor when SmartspaceSession has a good way to be
// mocked.
Executors.newCachedThreadPool(),
- SmartspaceSession.Callback { targets ->
+ SmartspaceSession.OnTargetsAvailableListener { targets ->
smartspaceMediaDataProvider.onTargetsAvailable(targets)
})
}