Add null check for mChannel object in WifiP2Settings
When user switch between settings of hotspot(Enable hotspot), Internet(Enable Wifi) and Wifi-Direct(establish, disconnect and forgot P2P connection). mChannel becomes null during WiFi P2P user scenarios resulting in Settings(com.android.settings) crash on enable Wifi. This commit fixes mChannel IllegalArgumentException: Channel needs to be initialized. Test: manual test Bug: 218608961 Change-Id: I72c67bcd1086afe2aa8d2c5521107e2d38e5b0bb
This commit is contained in:
committed by
Ritisha Pansotra
parent
19d06e79b9
commit
e20ddfa5f4
@@ -353,6 +353,7 @@ public class WifiP2pSettings extends DashboardFragment
|
|||||||
mWifiP2pManager.requestDeviceInfo(mChannel, WifiP2pSettings.this);
|
mWifiP2pManager.requestDeviceInfo(mChannel, WifiP2pSettings.this);
|
||||||
mIsIgnoreInitConnectionInfoCallback = false;
|
mIsIgnoreInitConnectionInfoCallback = false;
|
||||||
mWifiP2pManager.requestNetworkInfo(mChannel, networkInfo -> {
|
mWifiP2pManager.requestNetworkInfo(mChannel, networkInfo -> {
|
||||||
|
if (mChannel == null) return;
|
||||||
mWifiP2pManager.requestConnectionInfo(mChannel, wifip2pinfo -> {
|
mWifiP2pManager.requestConnectionInfo(mChannel, wifip2pinfo -> {
|
||||||
if (!mIsIgnoreInitConnectionInfoCallback) {
|
if (!mIsIgnoreInitConnectionInfoCallback) {
|
||||||
if (networkInfo.isConnected()) {
|
if (networkInfo.isConnected()) {
|
||||||
|
Reference in New Issue
Block a user