/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/wifi/

WifiConfigController2.java

public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode) {
mConfigUi = parent;
mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();

// Init Wi-Fi manager
mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
initWifiConfigController2(wifiEntry, mode);
//*/ 20230508,solve inputmethod popup causing Edit Error && Cast Exception 1
(scanForActivity(mContext)).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
//*/

}
//*/2023058,solve inputmethod popup cause Edit Error && Cast Exception 2
private static Activity scanForActivity(Context cont) {

if (cont == null)
return null;
else if (cont instanceof Activity)
return (Activity)cont;
else if (cont instanceof ContextWrapper)
return scanForActivity(((ContextWrapper)cont).getBaseContext());
return null;
}
//*/

@VisibleForTesting
public WifiConfigController2(WifiConfigUiBase2 parent, View view, WifiEntry wifiEntry,
int mode, WifiManager wifiManager) {
mConfigUi = parent;

mView = view;
mWifiEntry = wifiEntry;
mContext = mConfigUi.getContext();
mWifiManager = wifiManager;
initWifiConfigController2(wifiEntry, mode);
}