Fix Wi-Fi details crash in secondary users

- When Wi-Fi details are restricted for secondary users, UI components will be removed to prevent user interaction
  - The UI update function may not obtain the expected resources, causing NPE issues

Bug: 362151753
Flag: EXEMPT bugfix
Test: Manual testing
atest -c WifiNetworkDetailsFragmentTest

Change-Id: Ia97b4e202faff85ced0b6eaf2e4b4f0dc04b5cef
This commit is contained in:
Weng Su
2024-09-05 03:55:24 +08:00
parent e8c9816d15
commit c749ba028a
2 changed files with 13 additions and 0 deletions

View File

@@ -400,6 +400,9 @@ public class WifiNetworkDetailsFragment extends RestrictedDashboardFragment impl
@VisibleForTesting
void onHotspotNetworkChanged(WifiNetworkDetailsViewModel.HotspotNetworkData data) {
if (mIsUiRestricted) {
return;
}
PreferenceScreen screen = getPreferenceScreen();
if (screen == null) {
return;