Change default showClockAndComplications to false.

This makes sure existing behaviors don't change, and only dreams that
specify show dream overlay complications get them.

Change-Id: Ic5f440d0519432e6158c5aa64409abd402d48139
Test: atest DreamOverlayServiceTest
Bug: 214456383
Fix: 214456383
This commit is contained in:
Darrell Shi
2022-03-08 22:02:14 +00:00
parent d3f2dc954f
commit 008d1da7f5
3 changed files with 6 additions and 5 deletions

View File

@@ -231,7 +231,7 @@ public class DreamService extends Service implements Window.Callback {
* The default value for whether to show complications on the overlay.
* @hide
*/
public static final boolean DEFAULT_SHOW_COMPLICATIONS = true;
public static final boolean DEFAULT_SHOW_COMPLICATIONS = false;
private final IDreamManager mDreamManager;
private final Handler mHandler = new Handler(Looper.getMainLooper());

View File

@@ -173,19 +173,19 @@ public class DreamOverlayServiceTest extends SysuiTestCase {
}
@Test
public void testShouldShowComplicationsTrueByDefault() {
public void testShouldShowComplicationsFalseByDefault() {
mService.onBind(new Intent());
assertThat(mService.shouldShowComplications()).isTrue();
assertThat(mService.shouldShowComplications()).isFalse();
}
@Test
public void testShouldShowComplicationsSetByIntentExtra() {
final Intent intent = new Intent();
intent.putExtra(DreamService.EXTRA_SHOW_COMPLICATIONS, false);
intent.putExtra(DreamService.EXTRA_SHOW_COMPLICATIONS, true);
mService.onBind(intent);
assertThat(mService.shouldShowComplications()).isFalse();
assertThat(mService.shouldShowComplications()).isTrue();
}
@Test

View File

@@ -158,6 +158,7 @@ public class DreamOverlayStateControllerTest extends SysuiTestCase {
public void testComplicationFilteringWhenShouldShowComplications() {
final DreamOverlayStateController stateController =
new DreamOverlayStateController(mExecutor);
stateController.setShouldShowComplications(true);
final Complication alwaysAvailableComplication = Mockito.mock(Complication.class);
final Complication weatherComplication = Mockito.mock(Complication.class);