Merge "Saving `WifiConfiguration` into a local variable to avoid null pointer." into main
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java
index 340cb68..6b5a22a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/dialog/InternetDetailsContentController.java
@@ -1506,15 +1506,17 @@
Intent getConfiguratorQrCodeGeneratorIntentOrNull(WifiEntry wifiEntry) {
if (!mFeatureFlags.isEnabled(Flags.SHARE_WIFI_QS_BUTTON) || wifiEntry == null
- || mWifiManager == null || !wifiEntry.canShare()
- || wifiEntry.getWifiConfiguration() == null) {
+ || mWifiManager == null || !wifiEntry.canShare()) {
+ return null;
+ }
+ var wifiConfiguration = wifiEntry.getWifiConfiguration();
+ if (wifiConfiguration == null) {
return null;
}
Intent intent = new Intent();
intent.setAction(WifiDppIntentHelper.ACTION_CONFIGURATOR_AUTH_QR_CODE_GENERATOR);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- WifiDppIntentHelper.setConfiguratorIntentExtra(intent, mWifiManager,
- wifiEntry.getWifiConfiguration());
+ WifiDppIntentHelper.setConfiguratorIntentExtra(intent, mWifiManager, wifiConfiguration);
return intent;
}
}