Merge "Turn off WifiTetherSettings page." into oc-mr1-dev

This commit is contained in:
TreeHugger Robot
2017-09-20 16:17:28 +00:00
committed by Android (Google) Code Review
3 changed files with 13 additions and 7 deletions

View File

@@ -81,7 +81,7 @@ public class WifiApEnabler {
mContext = context; mContext = context;
mDataSaverBackend = dataSaverBackend; mDataSaverBackend = dataSaverBackend;
mSwitch = switchPreference; mSwitch = switchPreference;
mOriginalSummary = switchPreference.getSummary(); mOriginalSummary = context.getText(R.string.wifi_hotspot_off_subtext);
switchPreference.setPersistent(false); switchPreference.setPersistent(false);
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);

View File

@@ -46,7 +46,7 @@ public class WifiTetherSettings extends RestrictedDashboardFragment
implements WifiTetherBasePreferenceController.OnTetherConfigUpdateListener { implements WifiTetherBasePreferenceController.OnTetherConfigUpdateListener {
public static boolean isTetherSettingPageEnabled() { public static boolean isTetherSettingPageEnabled() {
return SystemProperties.getBoolean("settings.ui.wifi.tether.enabled", true); return SystemProperties.getBoolean("settings.ui.wifi.tether.enabled", false);
} }
private static final IntentFilter TETHER_STATE_CHANGE_FILTER; private static final IntentFilter TETHER_STATE_CHANGE_FILTER;

View File

@@ -16,6 +16,12 @@
package com.android.settings.wifi.tether; package com.android.settings.wifi.tether;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static com.google.common.truth.Truth.assertThat;
import android.app.Instrumentation; import android.app.Instrumentation;
import android.content.Intent; import android.content.Intent;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
@@ -33,11 +39,6 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
@RunWith(AndroidJUnit4.class) @RunWith(AndroidJUnit4.class)
@SmallTest @SmallTest
public class WifiTetherSettingsTest { public class WifiTetherSettingsTest {
@@ -63,6 +64,11 @@ public class WifiTetherSettingsTest {
mDevice.pressHome(); mDevice.pressHome();
} }
@Test
public void verifyPageIsDisabledByDefault() {
assertThat(WifiTetherSettings.isTetherSettingPageEnabled()).isFalse();
}
@Test @Test
public void launchTetherSettings_shouldHaveAllFields() { public void launchTetherSettings_shouldHaveAllFields() {
launchWifiTetherActivity(); launchWifiTetherActivity();