packages/apps/Settings
リビジョン | d785fbab68342e8ed8b47a8688a2232b3553bc53 (tree) |
---|---|
日時 | 2020-09-15 02:03:13 |
作者 | Arc Wang <arcwang@goog...> |
コミッター | Arc Wang |
[DO NOT MERGE][Wi-Fi] Fix fatal exception in WifiConnectionPreferenceController
WifiConnectionPreferenceController only shows when there are 2 SIMs,
it shows the connected Wi-Fi network.
WifiConnectionPreferenceController does not use WifiPickerTracker
to get a WifiEntry key. It should not launch WifiNetworkDetailsFragment2
which uses a WifiEntry key to find a WifiEntry.
Bug: 168280554
Test: manual
Change-Id: I2acea3564d2d89fe8e120064b33ef342c97edb60
@@ -18,7 +18,6 @@ package com.android.settings.wifi; | ||
18 | 18 | |
19 | 19 | import android.content.Context; |
20 | 20 | import android.os.Bundle; |
21 | -import android.util.FeatureFlagUtils; | |
22 | 21 | |
23 | 22 | import androidx.preference.PreferenceGroup; |
24 | 23 | import androidx.preference.PreferenceScreen; |
@@ -26,7 +25,6 @@ import androidx.preference.PreferenceScreen; | ||
26 | 25 | import com.android.settings.R; |
27 | 26 | import com.android.settings.core.SubSettingLauncher; |
28 | 27 | import com.android.settings.wifi.details.WifiNetworkDetailsFragment; |
29 | -import com.android.settings.wifi.details2.WifiNetworkDetailsFragment2; | |
30 | 28 | import com.android.settingslib.core.AbstractPreferenceController; |
31 | 29 | import com.android.settingslib.core.lifecycle.Lifecycle; |
32 | 30 | import com.android.settingslib.wifi.AccessPoint; |
@@ -131,31 +129,17 @@ public class WifiConnectionPreferenceController extends AbstractPreferenceContro | ||
131 | 129 | mPreference.refresh(); |
132 | 130 | mPreference.setOrder(order); |
133 | 131 | |
134 | - if (FeatureFlagUtils.isEnabled(mPrefContext, FeatureFlagUtils.SETTINGS_WIFITRACKER2)) { | |
135 | - mPreference.setOnPreferenceClickListener(pref -> { | |
136 | - Bundle args = new Bundle(); | |
137 | - mPreference.getAccessPoint().saveWifiState(args); | |
138 | - new SubSettingLauncher(mPrefContext) | |
139 | - .setTitleRes(R.string.pref_title_network_details) | |
140 | - .setDestination(WifiNetworkDetailsFragment2.class.getName()) | |
141 | - .setArguments(args) | |
142 | - .setSourceMetricsCategory(mMetricsCategory) | |
143 | - .launch(); | |
144 | - return true; | |
145 | - }); | |
146 | - } else { | |
147 | - mPreference.setOnPreferenceClickListener(pref -> { | |
148 | - Bundle args = new Bundle(); | |
149 | - mPreference.getAccessPoint().saveWifiState(args); | |
150 | - new SubSettingLauncher(mPrefContext) | |
151 | - .setTitleRes(R.string.pref_title_network_details) | |
152 | - .setDestination(WifiNetworkDetailsFragment.class.getName()) | |
153 | - .setArguments(args) | |
154 | - .setSourceMetricsCategory(mMetricsCategory) | |
155 | - .launch(); | |
156 | - return true; | |
157 | - }); | |
158 | - } | |
132 | + mPreference.setOnPreferenceClickListener(pref -> { | |
133 | + Bundle args = new Bundle(); | |
134 | + mPreference.getAccessPoint().saveWifiState(args); | |
135 | + new SubSettingLauncher(mPrefContext) | |
136 | + .setTitleRes(R.string.pref_title_network_details) | |
137 | + .setDestination(WifiNetworkDetailsFragment.class.getName()) | |
138 | + .setArguments(args) | |
139 | + .setSourceMetricsCategory(mMetricsCategory) | |
140 | + .launch(); | |
141 | + return true; | |
142 | + }); | |
159 | 143 | mPreferenceGroup.addPreference(mPreference); |
160 | 144 | } |
161 | 145 | } |