Remove silky flag from System for official release

Remove the silky condition and clean up redundant files.

Bug: 183670633
Test: robotests & visual
Change-Id: I2743a65869c4fe2ea684e259373ddc309dea59c3
This commit is contained in:
Yanting Yang
2021-05-26 23:49:28 +08:00
parent d5aaf326e7
commit 5035ef9f94
7 changed files with 23 additions and 261 deletions

View File

@@ -20,22 +20,9 @@ import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.provider.Settings;
import android.util.FeatureFlagUtils;
import androidx.preference.Preference;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.shadow.ShadowSecureSettings;
import com.android.settingslib.core.AbstractPreferenceController;
import org.junit.Before;
@@ -46,7 +33,6 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.util.ReflectionHelpers;
import java.util.ArrayList;
@@ -57,8 +43,6 @@ public class GesturesSettingsPreferenceControllerTest {
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private Activity mActivity;
@Mock
private Preference mPreference;
private GesturesSettingPreferenceController mController;
@@ -67,7 +51,6 @@ public class GesturesSettingsPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
FakeFeatureFactory.setupForTest();
mController = new GesturesSettingPreferenceController(mActivity);
FeatureFlagUtils.setEnabled(RuntimeEnvironment.application, FeatureFlags.SILKY_HOME, false);
}
@Test
@@ -96,43 +79,4 @@ public class GesturesSettingsPreferenceControllerTest {
assertThat(mController.isAvailable()).isFalse();
}
@Test
@Config(shadows = ShadowSecureSettings.class)
public void updateState_assistSupported_shouldSetToAssistGestureStatus() {
final FakeFeatureFactory featureFactory =
(FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
when(featureFactory.assistGestureFeatureProvider.isSupported(any(Context.class)))
.thenReturn(true);
when(featureFactory.assistGestureFeatureProvider.isSensorAvailable(any(Context.class)))
.thenReturn(true);
final ContentResolver cr = mActivity.getContentResolver();
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 0);
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 0);
mController.updateState(mPreference);
verify(mActivity).getText(R.string.language_input_gesture_summary_off);
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 1);
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 0);
mController.updateState(mPreference);
verify(mActivity).getText(R.string.language_input_gesture_summary_on_with_assist);
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_ENABLED, 0);
Settings.Secure.putInt(cr, Settings.Secure.ASSIST_GESTURE_SILENCE_ALERTS_ENABLED, 1);
mController.updateState(mPreference);
verify(mActivity).getText(R.string.language_input_gesture_summary_on_non_assist);
}
@Test
@Config(shadows = ShadowSecureSettings.class)
public void updateState_sensorNotAvailable_shouldSetToEmptyStatus() {
final FakeFeatureFactory featureFactory =
(FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
when(featureFactory.assistGestureFeatureProvider.isSensorAvailable(any(Context.class)))
.thenReturn(false);
mController.updateState(mPreference);
verify(mPreference).setSummary("");
}
}