All the descendants of TogglePreferenceController are now slice-able by
default, where every controller can still disable it by overriding this
value. Though all of them are now slice-able, doesn't necessarily means
they are exposed publicly as we set the default value of isPublicSlice()
to false. For those that want to be public ones will have to override
this value.
Bug:
141088937
Test: robotests
Change-Id: I2ea529c11f0177cd6c55754b632cd1fea1dcc48f
return SliceData.SliceType.SWITCH;
}
+ @Override
+ public boolean isSliceable() {
+ return true;
+ }
+
+ @Override
+ public boolean isPublicSlice() {
+ return false;
+ }
}
\ No newline at end of file
SliceData.SliceType.SWITCH);
}
+ @Test
+ public void isSliceable_returnTrue() {
+ assertThat(mToggleController.isSliceable()).isTrue();
+ }
+
+ @Test
+ public void isPublicSlice_returnFalse() {
+ assertThat(mToggleController.isPublicSlice()).isFalse();
+ }
+
private static class FakeToggle extends TogglePreferenceController {
private boolean checkedFlag;