Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a955648b authored by Weng Su's avatar Weng Su
Browse files

Don't set the Wi-Fi dialog to the topmost UI

- Set Wi-Fi dialog to topmost UI only when called by SysUI

Bug: 293965733
Flag: None
Test: Manual testing
atest -c WifiDialogActivityTest

Change-Id: I9215b3e7f86c0d31fa0c4c492f29032c3d14ad6d
parent e1303ffa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ open class WifiDialog2 @JvmOverloads constructor(
    @StyleRes style: Int = 0,
    private val hideSubmitButton: Boolean = mode == WifiConfigUiBase2.MODE_VIEW,
    private val hideMeteredAndPrivacy: Boolean = false,
    private val isSysUiCaller: Boolean = false,
) : AlertDialog(context, style), WifiConfigUiBase2, DialogInterface.OnClickListener {
    /**
     * Host UI component of WifiDialog2 can receive callbacks by this interface.
@@ -71,7 +72,9 @@ open class WifiDialog2 @JvmOverloads constructor(
    override fun getController(): WifiConfigController2 = controller

    override fun onCreate(savedInstanceState: Bundle?) {
        if (isSysUiCaller) {
            setWindowsOverlay()
        }
        view = layoutInflater.inflate(R.layout.wifi_dialog, null)
        setView(view)
        controller = WifiConfigController2(this, view, wifiEntry, mode, hideMeteredAndPrivacy)
+5 −1
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import androidx.annotation.VisibleForTesting;

import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.Utils;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.wifi.dpp.WifiDppUtils;
import com.android.settingslib.core.lifecycle.ObservableActivity;
@@ -172,7 +173,10 @@ public class WifiDialogActivity extends ObservableActivity implements WifiDialog
        } else {
            if (mIsWifiTrackerLib) {
                mDialog2 = new WifiDialog2(this, this,
                        mNetworkDetailsTracker.getWifiEntry(), WifiConfigUiBase2.MODE_CONNECT);
                        mNetworkDetailsTracker.getWifiEntry(), WifiConfigUiBase2.MODE_CONNECT,
                        0 /* style */, false /* hideSubmitButton */,
                        false /* hideMeteredAndPrivacy */,
                        Utils.SYSTEMUI_PACKAGE_NAME.equals(getLaunchedFromPackage()));
            } else {
                mDialog = WifiDialog.createModal(
                        this, this, mAccessPoint, WifiConfigUiBase.MODE_CONNECT);