Enable(visible) or Disabled(invisible) all one-handed settings

preference by System Property flag configuration.

To check System Property flag "support_one_handed_mode" configuration
then enable(visible) or disable(invisible) all one-handed settings
preference.

Bug: 154290458

Test: manual
Test: RunSettingsRoboTests
Change-Id: Ib6ed12dd65e66747e53b6333574ba0ad5be3c6e0
This commit is contained in:
Jason Chang
2020-04-21 17:36:53 +08:00
parent 66ce3302c8
commit f62888975e
4 changed files with 54 additions and 3 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.gestures;
import static com.google.common.truth.Truth.assertThat;
import android.content.Context;
import android.os.SystemProperties;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
@@ -57,11 +58,21 @@ public class OneHandedEnablePreferenceControllerTest {
}
@Test
public void getAvailabilityStatus_byDefault_shouldAvailable() {
public void getAvailabilityStatus_setSupportOneHandedModeProperty_shouldAvailable() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "true");
assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.AVAILABLE);
}
@Test
public void getAvailabilityStatus_unsetSupportOneHandedModeProperty_shouldUnsupported() {
SystemProperties.set(OneHandedEnablePreferenceController.SUPPORT_ONE_HANDED_MODE, "false");
assertThat(mController.getAvailabilityStatus())
.isEqualTo(BasePreferenceController.UNSUPPORTED_ON_DEVICE);
}
@Test
public void getSummary_enabledOneHanded_shouldDisplayOnSummary() {
OneHandedSettingsUtils.setSettingsOneHandedModeEnabled(mContext, true);