Add a Preference into "Network & internet" for new tethering UI

Adding a MasterSwitchPreference into "Network & internet" and create
corresponding controller. The preference is hidden by the feature flag.
It does NOT affect the existing UI.

Bug: 146147778
Test: CodeInspectionTest, TetherPreferenceControllerTest,
NetworkDashboardFragmentTest
Change-Id: Ida8e088efbb22d0c983acecbc420672206392dad
This commit is contained in:
Zhen Zhang
2020-02-10 19:19:54 -08:00
parent 20cae52e36
commit 31f1a34629
5 changed files with 266 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ import static com.android.settings.network.MobilePlanPreferenceController.MANAGE
import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import androidx.appcompat.app.AlertDialog;
@@ -65,6 +66,13 @@ public class NetworkDashboardFragment extends DashboardFragment implements
use(MultiNetworkHeaderController.class).init(getSettingsLifecycle());
use(AirplaneModePreferenceController.class).setFragment(this);
use(AllInOneTetherPreferenceController.class).init(getSettingsLifecycle());
}
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
super.onCreatePreferences(savedInstanceState, rootKey);
use(AllInOneTetherPreferenceController.class).initEnabler(getSettingsLifecycle());
}
@Override