Add a new feature flag for the expand button in support lib.
- check the feature flag to determine whether to use the existing progressive disclosure mixin or use the expand button in the support library. - add corresponding preference xml files that add the new preference group attribute to use with the expand button in the support lib. Bug: 63985174 Test: make RunSettingsRoboTests Change-Id: Ida6eb6182a8066ad1413b7f6142512345fd914d0
This commit is contained in:
@@ -21,6 +21,7 @@ import android.content.Context;
|
||||
import android.media.AudioManager;
|
||||
import android.os.UserManager;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.dashboard.ProgressiveDisclosureMixin;
|
||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||
import com.android.settings.TestConfig;
|
||||
import com.android.settings.testutils.XmlTestUtils;
|
||||
@@ -30,6 +31,7 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
import org.robolectric.util.ReflectionHelpers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -59,7 +61,10 @@ public class SoundSettingsTest {
|
||||
|
||||
final List<String> niks = SoundSettings.SEARCH_INDEX_DATA_PROVIDER
|
||||
.getNonIndexableKeys(context);
|
||||
final int xmlId = (new SoundSettings()).getPreferenceScreenResId();
|
||||
SoundSettings settings = new SoundSettings();
|
||||
ReflectionHelpers.setField(settings, "mProgressiveDisclosureMixin",
|
||||
mock(ProgressiveDisclosureMixin.class));
|
||||
final int xmlId = settings.getPreferenceScreenResId();
|
||||
final List<String> keys = XmlTestUtils.getKeysFromPreferenceXml(context, xmlId);
|
||||
keys.addAll(XmlTestUtils.getKeysFromPreferenceXml(context,
|
||||
R.xml.zen_mode_settings));
|
||||
|
Reference in New Issue
Block a user