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

@@ -295,6 +295,12 @@ public class NetworkProviderSettings extends RestrictedSettingsFragment
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
final Context context = getContext();
if (context != null && !context.getResources().getBoolean(
R.bool.config_show_internet_settings)) {
finish();
return;
}
mAirplaneModeEnabler = new AirplaneModeEnabler(getContext(), this);
// TODO(b/37429702): Add animations and preference comparator back after initial screen is