Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7b3ac73 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Clean up AllInOneTetherSettings" into main

parents db72f4ea 0664d3cc
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
@@ -2308,8 +2308,6 @@
    <string name="wifi_hotspot_name_title">Hotspot name</string>
    <!-- Label for Wifi hotspot password. -->
    <string name="wifi_hotspot_password_title">Hotspot password</string>
    <!-- Label for Wifi hotspot AP Band. -->
    <string name="wifi_hotspot_ap_band_title">AP Band</string>
    <!-- Title for the toggle to turn off hotspot automatically [CHAR LIMIT=NONE]-->
    <string name="wifi_hotspot_auto_off_title">Turn off hotspot automatically</string>
@@ -3409,29 +3407,8 @@
    <!-- Tethering preference summary when hotspot and tethering are off [CHAR LIMIT=NONE]-->
    <string name="tether_preference_summary_off">Off</string>
    <!-- Tethering interface options [CHAR LIMIT=NONE]-->
    <string name="tethering_interface_options">Tethering</string>
    <!-- Disable Wifi Hotspot option-->
    <!-- Don't use Wi-Fi hotspot title [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_title">Don\u2019t use Wi\u2011Fi hotspot</string>
    <!-- Don't use Wi-Fi hotspot summary when USB tethering is chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_on">Only share internet via USB</string>
    <!-- Don't use Wi-Fi hotspot summary when Bluetooth tethering is chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_bluetooth_on">Only share internet via Bluetooth</string>
    <!-- Don't use Wi-Fi hotspot summary when Ethernet tethering is chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_ethernet_on">Only share internet via Ethernet</string>
    <!-- Don't use Wi-Fi hotspot summary when USB tethering and Bluetooth tethering are chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_and_bluetooth_on">Only share internet via USB and Bluetooth</string>
    <!-- Don't use Wi-Fi hotspot summary when USB tethering and Ethernet tethering are chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_and_ethernet_on">Only share internet via USB and Ethernet</string>
    <!-- Don't use Wi-Fi hotspot summary when Bluetooth tethering and Ethernet tethering are chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_bluetooth_and_ethernet_on">Only share internet via Bluetooth and Ethernet</string>
    <!-- Don't use Wi-Fi hotspot summary when USB, Bluetooth and Ethernet tethering are chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_and_bluetooth_and_ethernet_on">Only share internet via USB, Bluetooth and Ethernet</string>
    <!-- USB Tethering options -->
    <string name="usb_title">USB</string>
    <!-- Label for USB tethering switch [CHAR LIMIT=NONE]-->
    <string name="usb_tethering_button_text">USB tethering</string>
    <!-- Bluetooth Tethering settings-->

res/xml/all_tether_prefs.xml

deleted100644 → 0
+0 −100
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="all_tether_prefs_screen"
    android:title="@string/tether_settings_title_all"
    settings:searchable="false">

    <PreferenceCategory
        android:key="wifi_tether_settings_group"
        android:title="@string/wifi_hotspot_checkbox_text"
        settings:searchable="false">
        <com.android.settings.wifi.tether.WifiTetherSsidPreference
            android:key="wifi_tether_network_name_2"
            android:title="@string/wifi_hotspot_name_title"
            android:summary="@string/summary_placeholder"/>

        <com.android.settings.widget.ValidatedEditTextPreference
            android:key="wifi_tether_network_password_2"
            android:persistent="false"
            android:title="@string/wifi_hotspot_password_title"/>

        <SwitchPreferenceCompat
            android:key="wifi_tether_auto_turn_off_2"
            android:title="@string/wifi_hotspot_auto_off_title"
            android:summary="@string/wifi_hotspot_auto_off_summary"/>

        <ListPreference
            android:key="wifi_tether_network_ap_band_2"
            android:title="@string/wifi_hotspot_ap_band_title"/>

        <ListPreference
            android:key="wifi_tether_security_2"
            android:title="@string/wifi_security"
            android:summary="@string/summary_placeholder"
            android:entries="@array/wifi_tether_security"
            android:entryValues="@array/wifi_tether_security_values"/>
    </PreferenceCategory>

    <PreferenceCategory
        android:key="tethering_options_group"
        android:title="@string/tethering_interface_options"
        settings:searchable="false">
        <SwitchPreferenceCompat
            android:key="enable_usb_tethering"
            android:title="@string/usb_tethering_button_text"
            android:summary="@string/usb_tethering_subtext"
            settings:controller="com.android.settings.network.UsbTetherPreferenceController"
            settings:keywords="@string/keywords_hotspot_tethering" />

        <SwitchPreferenceCompat
            android:key="enable_bluetooth_tethering_2"
            android:title="@string/bluetooth_tether_checkbox_text"
            android:summary="@string/bluetooth_tethering_subtext"
            settings:controller="com.android.settings.network.BluetoothTetherPreferenceController"
            settings:keywords="@string/keywords_hotspot_tethering" />

        <SwitchPreferenceCompat
            android:key="enable_ethernet_tethering_2"
            android:title="@string/ethernet_tether_checkbox_text"
            android:summary="@string/ethernet_tethering_subtext"
            settings:controller="com.android.settings.network.EthernetTetherPreferenceController"
            settings:keywords="@string/keywords_hotspot_tethering"/>

        <SwitchPreferenceCompat
            android:key="disable_wifi_tethering"
            android:title="@string/disable_wifi_hotspot_title"
            android:summary="@string/summary_placeholder"
            settings:controller="com.android.settings.network.WifiTetherDisablePreferenceController"
            settings:keywords="@string/keywords_hotspot_tethering" />
    </PreferenceCategory>

    <Preference
        android:key="disabled_on_data_saver_2"
        android:summary="@string/tether_settings_disabled_on_data_saver"
        android:selectable="false"
        settings:searchable="false"
        settings:allowDividerAbove="true" />

    <com.android.settingslib.widget.FooterPreference
        android:key="tether_prefs_footer_2"
        android:selectable="false"
        settings:searchable="false"/>
</PreferenceScreen>
+0 −12
Original line number Diff line number Diff line
@@ -70,18 +70,6 @@
        settings:userRestriction="no_config_tethering"
        settings:useAdminDisabledSummary="true" />

    <com.android.settingslib.PrimarySwitchPreference
        android:fragment="com.android.settings.AllInOneTetherSettings"
        android:key="all_tether_settings"
        android:title="@string/tether_settings_title_all"
        android:icon="@drawable/ic_wifi_tethering"
        android:order="6"
        android:summary="@string/summary_placeholder"
        settings:controller="com.android.settings.network.AllInOneTetherPreferenceController"
        settings:keywords="@string/keywords_hotspot_tethering"
        settings:userRestriction="no_config_tethering"
        settings:useAdminDisabledSummary="true" />

    <com.android.settings.datausage.DataSaverPreference
        android:key="restrict_background_parent_entry"
        android:title="@string/data_saver_title"
+0 −444

File deleted.

Preview size limit exceeded, changes collapsed.

+2 −39
Original line number Diff line number Diff line
@@ -19,18 +19,15 @@ package com.android.settings;
import static android.provider.Settings.ACTION_PRIVACY_SETTINGS;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.ims.ImsRcsManager;
import android.text.TextUtils;
import android.util.FeatureFlagUtils;
import android.util.Log;

import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.biometrics.face.FaceSettings;
import com.android.settings.communal.CommunalPreferenceController;
import com.android.settings.core.FeatureFlags;
import com.android.settings.enterprise.EnterprisePrivacySettings;
import com.android.settings.network.MobileNetworkIntentConverter;
import com.android.settings.overlay.FeatureFactory;
@@ -58,42 +55,8 @@ public class Settings extends SettingsActivity {
    public static class FingerprintSettingsActivityV2 extends SettingsActivity { /* empty */ }
    public static class CombinedBiometricSettingsActivity extends SettingsActivity { /* empty */ }
    public static class CombinedBiometricProfileSettingsActivity extends SettingsActivity { /* empty */ }
    public static class TetherSettingsActivity extends SettingsActivity {
        // TODO(b/147675042): Clean the override up when we enable the new Fragment persistently.
        @Override
        public Intent getIntent() {
            return wrapIntentWithAllInOneTetherSettingsIfNeeded(
                    getApplicationContext(), super.getIntent());
        }
    }
    public static class WifiTetherSettingsActivity extends SettingsActivity {
        // TODO(b/147675042): Clean the override up when we enable the new Fragment persistently.
        @Override
        public Intent getIntent() {
            return wrapIntentWithAllInOneTetherSettingsIfNeeded(
                    getApplicationContext(), super.getIntent());
        }
    }

    private static Intent wrapIntentWithAllInOneTetherSettingsIfNeeded(
            Context context, Intent superIntent) {
        if (!FeatureFlagUtils.isEnabled(context, FeatureFlags.TETHER_ALL_IN_ONE)) {
            return superIntent;
        }

        final Intent modIntent = new Intent(superIntent);
        modIntent.putExtra(EXTRA_SHOW_FRAGMENT,
                AllInOneTetherSettings.class.getCanonicalName());
        Bundle args = superIntent.getBundleExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS);
        if (args != null) {
            args = new Bundle(args);
        } else {
            args = new Bundle();
        }
        args.putParcelable("intent", superIntent);
        modIntent.putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
        return modIntent;
    }
    public static class TetherSettingsActivity extends SettingsActivity { /* empty */ }
    public static class WifiTetherSettingsActivity extends SettingsActivity { /* empty */ }

    public static class VpnSettingsActivity extends SettingsActivity { /* empty */ }
    /** Activity for Data saver settings. */
Loading