Add flag to control Internet preference

This CL adds a flag named config_show_internet_settings so access to
Internet preference can be easily customized as Wi-fi preference was in
the past, this level of customization was lost when Internet preference
was introduced here ag/13053253.

Bug: 271203982
Test: make -j32 Settings
Test: atest -c InternetPreferenceControllerTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0af54a1d3cfa26ba5f23b5d8c74ade2bb582f76f)
Merged-In: Iaf9a18f9389be089304d11bd3206d6917ab85124

Change-Id: Iaf9a18f9389be089304d11bd3206d6917ab85124
This commit is contained in:
David Jacobo
2023-05-05 19:51:35 -07:00
parent bc48abe0bd
commit 0e9c157c36
4 changed files with 14 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ import androidx.test.annotation.UiThreadTest;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.android.settings.R;
import com.android.settings.testutils.ResourcesUtils;
import com.android.settings.wifi.WifiPickerTrackerHelper;
import com.android.settings.wifi.WifiSummaryUpdater;
@@ -188,8 +189,9 @@ public class InternetPreferenceControllerTest {
}
@Test
public void isAvailable_shouldBeTrue() {
assertThat(mController.isAvailable()).isTrue();
public void isAvailable_shouldMatchPrefFlag() {
assertThat(mController.isAvailable()).isEqualTo(
mContext.getResources().getBoolean(R.bool.config_show_internet_settings));
}
@Test