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

Commit bef0f617 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #7343719: GlobalActions dialog (power off / airplane mode / sound off)

does not show if you press on power button when the "low battery" dialog is showing up

Always put the global actions dialog in the keyguard dialog layer (above
the keyguard).  I don't see any reason to have it change layers based
on whether the keyguard is showing.

Change-Id: I1bd3600af9f115d662d2a4783f835e234db1b7f0
parent 40b7ea44
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -290,7 +290,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
                                    }
                                });
                        AlertDialog dialog = builder.create();
                        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
                        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
                        dialog.show();
                    }

@@ -339,7 +339,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
                        return mAdapter.getItem(position).onLongPress();
                    }
        });
        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
        dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);

        dialog.setOnDismissListener(this);

@@ -390,11 +390,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
        refreshSilentMode();
        mAirplaneModeOn.updateState(mAirplaneState);
        mAdapter.notifyDataSetChanged();
        if (mKeyguardShowing) {
        mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG);
        } else {
            mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
        }
        if (SHOW_SILENT_TOGGLE) {
            IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
            mContext.registerReceiver(mRingerModeReceiver, filter);