Convert xml based API allowDynamicSummaryInSlice to java
- Add boolean useDynamicSliceSummary() in Sliceable interface. This is the switch equivalent to android:allowDynamicSummaryInSlice in xml. It moves the setter closer to regular Sliceable APIs, thus less easily to miss. - Coverted all android:allowDynamicSummaryInSlice to use the java API. - Except 2 prefs in my_device_info. They incorrectly set this to true previously (controller is not sliceable, no point setting dynamicSliceSummary to true. They just won't do anything) Fixes: 128446156 Test: robolectric Change-Id: Ic57acd590dec3e87dcf4592df137321d14b854d9
This commit is contained in:
@@ -37,8 +37,7 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class RemoteVolumePreferenceController extends
|
||||
VolumeSeekBarPreferenceController {
|
||||
public class RemoteVolumePreferenceController extends VolumeSeekBarPreferenceController {
|
||||
|
||||
private static final String KEY_REMOTE_VOLUME = "remote_volume";
|
||||
@VisibleForTesting
|
||||
@@ -167,6 +166,11 @@ public class RemoteVolumePreferenceController extends
|
||||
return TextUtils.equals(getPreferenceKey(), KEY_REMOTE_VOLUME);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useDynamicSliceSummary() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPreferenceKey() {
|
||||
return KEY_REMOTE_VOLUME;
|
||||
|
||||
Reference in New Issue
Block a user