Remove SmartSpaceComplication when the SmartspaceTargetListener is removed.
The listener removes the SmartSpaceComplication when the targets becomes empty. If the listener isn't connected, we don't know whether/when the targets becomes empty. Therefore we should just remove the complication when the listener is removed. This fixes the extra DATE card impression on the Dream surface. The CardPagerAdapter adds a default DATE card when its setTargets method is called with an empty list. This CL ensures that for Dream Smartspace, the setTargets method is never called with an empty list. Reorganized the existing testAvailability() test into multiple tests. The new logic is tested in testOverlayInActive_removesTargetListener_removesComplication(). Bug: 231251252 Test: on device via `adb logcat ...` Test: atest SmartSpaceComplicationTest Change-Id: Iac0d8a9697f42e2c70c83c5da050f17190fcc3c1
Loading
Please register or sign in to comment