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

Commit 6871807a authored by changbetty's avatar changbetty
Browse files

Set the attribute of the dialog window for overlay QS internet panel

Bug: 190460969
Test: Manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiDialog2Test

Change-Id: I1acdfb09393163bb94824fe2b3bad0391ba4fb53
Merged-In: I1acdfb09393163bb94824fe2b3bad0391ba4fb53
parent 1741d5d1
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -21,6 +21,9 @@ import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
@@ -108,6 +111,8 @@ public class WifiDialog2 extends AlertDialog implements WifiConfigUiBase2,

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setWindowsOverlay();

        mView = getLayoutInflater().inflate(R.layout.wifi_dialog, /* root */ null);
        setView(mView);
        mController = new WifiConfigController2(this, mView, mWifiEntry, mMode);
@@ -126,6 +131,16 @@ public class WifiDialog2 extends AlertDialog implements WifiConfigUiBase2,
        }
    }

    private void setWindowsOverlay() {
        final Window window = getWindow();
        final WindowManager.LayoutParams lp = window.getAttributes();
        window.setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
        lp.setFitInsetsTypes(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
        lp.setFitInsetsSides(WindowInsets.Side.all());
        lp.setFitInsetsIgnoringVisibility(true);
        window.setAttributes(lp);
    }

    @Override
    protected void onStart() {
        final ImageButton ssidScannerButton = findViewById(R.id.ssid_scanner_button);