Merge "Remove "Hotspot" key from settings search if not needed" into tm-qpr-dev am: 58292e7058
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20307409 Change-Id: I87b186f17e8126638d5d09d6e9970b590d12ff6e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -37,6 +37,7 @@ import android.net.TetheringManager;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserManager;
|
||||
import android.util.FeatureFlagUtils;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
@@ -44,6 +45,7 @@ import androidx.preference.PreferenceScreen;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.FeatureFlags;
|
||||
import com.android.settings.dashboard.RestrictedDashboardFragment;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowFragment;
|
||||
@@ -93,6 +95,7 @@ public class WifiTetherSettingsTest {
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
FeatureFlagUtils.setEnabled(mContext, FeatureFlags.TETHER_ALL_IN_ONE, false);
|
||||
setCanShowWifiHotspotCached(true);
|
||||
doReturn(mWifiManager).when(mContext).getSystemService(WifiManager.class);
|
||||
doReturn(mConnectivityManager)
|
||||
@@ -218,6 +221,22 @@ public class WifiTetherSettingsTest {
|
||||
assertThat(keys).contains(WifiTetherSettings.KEY_WIFI_TETHER_MAXIMIZE_COMPATIBILITY);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isPageSearchEnabled_canShowWifiHotspot_returnTrue() {
|
||||
setCanShowWifiHotspotCached(true);
|
||||
|
||||
assertThat(WifiTetherSettings.SEARCH_INDEX_DATA_PROVIDER.isPageSearchEnabled(mContext))
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isPageSearchEnabled_canNotShowWifiHotspot_returnFalse() {
|
||||
setCanShowWifiHotspotCached(false);
|
||||
|
||||
assertThat(WifiTetherSettings.SEARCH_INDEX_DATA_PROVIDER.isPageSearchEnabled(mContext))
|
||||
.isFalse();
|
||||
}
|
||||
|
||||
private void spyWifiTetherSettings() {
|
||||
mWifiTetherSettings = spy(new WifiTetherSettings(mWifiRestriction));
|
||||
final FragmentActivity activity = mock(FragmentActivity.class);
|
||||
|
||||
Reference in New Issue
Block a user