[Thread] update Thread settings screen

Per b/327098435 the new Thread settings design proposed
(go/android-thread) is approved.

As a summary, this commit adds a new "connected devices > connection
preference -> Thread" list item and decidated config page for Thread.
Also, we simplified the airplane mode to delegate it to the mainline
code to handle it

Bug: 327098435
Test: atest SettingsUnitTests
Merged-In: Iffbb2471f5a28ec57d30a378f22642fe6ac0b9cc
Change-Id: Iffbb2471f5a28ec57d30a378f22642fe6ac0b9cc
This commit is contained in:
Kangping Dong
2024-05-05 21:03:37 +08:00
parent 91d5413375
commit ab7f48dcde
15 changed files with 837 additions and 509 deletions

View File

@@ -54,12 +54,23 @@
settings:keywords="@string/keywords_wifi_display_settings"/>
<com.android.settingslib.RestrictedPreference
android:key="connected_device_printing"
android:title="@string/print_settings"
android:summary="@string/summary_placeholder"
android:icon="@*android:drawable/ic_settings_print"
android:fragment="com.android.settings.connecteddevice.threadnetwork.ThreadNetworkFragment"
android:key="thread_network_settings"
android:title="@string/thread_network_settings_title"
android:icon="@*android:drawable/ic_thread_network"
android:order="-5"
settings:searchable="false"
settings:controller="com.android.settings.connecteddevice.threadnetwork.ThreadNetworkFragmentController"
settings:userRestriction="no_thread_network"
settings:useAdminDisabledSummary="true"/>
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.print.PrintSettingsFragment"
android:order="-3"/>
android:icon="@*android:drawable/ic_settings_print"
android:key="connected_device_printing"
android:order="-3"
android:summary="@string/summary_placeholder"
android:title="@string/print_settings" />
<SwitchPreferenceCompat
android:key="uwb_settings"
@@ -70,15 +81,6 @@
settings:userRestriction="no_ultra_wideband_radio"
settings:useAdminDisabledSummary="true"/>
<com.android.settingslib.RestrictedSwitchPreference
android:key="thread_network_settings"
android:title="@string/thread_network_settings_title"
android:order="110"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.connecteddevice.threadnetwork.ThreadNetworkPreferenceController"
settings:userRestriction="no_thread_network"
settings:useAdminDisabledSummary="true"/>
<PreferenceCategory
android:key="dashboard_tile_placeholder"
android:order="-8"/>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2024 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:title="@string/thread_network_settings_title">
<com.android.settingslib.widget.MainSwitchPreference
android:key="toggle_thread_network"
android:title="@string/thread_network_settings_main_switch_title"
settings:controller="com.android.settings.connecteddevice.threadnetwork.ThreadNetworkToggleController"/>
<com.android.settingslib.widget.FooterPreference
android:key="thread_network_settings_footer"
android:title="@string/thread_network_settings_footer_title"
android:selectable="false"
settings:searchable="false"
settings:controller="com.android.settings.connecteddevice.threadnetwork.ThreadNetworkFooterController"/>
</PreferenceScreen>