Add feature flag check for mainline module version.
- in about phone settings, only show the mainline module version if the feature is enabled. Bug: 122615240 Test: make RunSettingsRoboTests Change-Id: If872859755dade7e601a47eb387d10c3b247d06e
This commit is contained in:
@@ -25,6 +25,9 @@ import static org.mockito.Mockito.when;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -52,6 +55,17 @@ public class ModuleVersionDialogControllerTest {
|
||||
when(mDialog.getContext()).thenReturn(mContext);
|
||||
when(mContext.getPackageManager()).thenReturn(mPackageManager);
|
||||
mController = new ModuleVersionDialogController(mDialog);
|
||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void initialize_featureDisabled_shouldRemoveSettingFromDialog() {
|
||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.MAINLINE_MODULE, false);
|
||||
|
||||
mController.initialize();
|
||||
|
||||
verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_LABEL_ID);
|
||||
verify(mDialog).removeSettingFromScreen(mController.MODULE_VERSION_VALUE_ID);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user