mContext = context;
mDataSaverBackend = dataSaverBackend;
mSwitch = switchPreference;
- mOriginalSummary = switchPreference.getSummary();
+ mOriginalSummary = context.getText(R.string.wifi_hotspot_off_subtext);
switchPreference.setPersistent(false);
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
implements WifiTetherBasePreferenceController.OnTetherConfigUpdateListener {
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;
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.content.Intent;
import android.support.test.InstrumentationRegistry;
import org.junit.Test;
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)
@SmallTest
public class WifiTetherSettingsTest {
}
@Test
+ public void verifyPageIsDisabledByDefault() {
+ assertThat(WifiTetherSettings.isTetherSettingPageEnabled()).isFalse();
+ }
+
+ @Test
public void launchTetherSettings_shouldHaveAllFields() {
launchWifiTetherActivity();
onView(withText("Network name")).check(matches(isDisplayed()));