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

Commit 0e060dad authored by Fan Zhang's avatar Fan Zhang Committed by Android (Google) Code Review
Browse files

Merge "Do not allow draw on top for default sms picker."

parents 6344182d 9d46e1fd
Loading
Loading
Loading
Loading
+21 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.settings;

import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;

import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
@@ -30,6 +32,8 @@ import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
@@ -59,6 +63,21 @@ public final class SmsDefaultDialog extends AlertActivity implements
        }
    }

    @Override
    protected void onStart() {
        super.onStart();
        getWindow().addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
    }

    @Override
    protected void onStop() {
        super.onStop();
        final Window window = getWindow();
        final WindowManager.LayoutParams attrs = window.getAttributes();
        attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
        window.setAttributes(attrs);
    }

    @Override
    public void onClick(DialogInterface dialog, int which) {
        switch (which) {