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

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

Fix issue #2133206: dialogs/menus should auto-dismiss when screen turns off

Lot of infrastructure for more things to go away when "clear system dialogs"
happens, and now do this when we turn on the lock screen.

Change-Id: I567130296fe47ce82df065ed58ef21b37416ceaf
parent f11cc96e
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -3573,6 +3573,17 @@
 visibility="public"
>
</field>
<field name="finishOnCloseSystemDialogs"
 type="int"
 transient="false"
 volatile="false"
 value="16843431"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="finishOnTaskLaunch"
 type="int"
 transient="false"
@@ -39185,6 +39196,17 @@
 visibility="public"
>
</field>
<field name="FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS"
 type="int"
 transient="false"
 volatile="false"
 value="256"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="FLAG_FINISH_ON_TASK_LAUNCH"
 type="int"
 transient="false"
@@ -156755,6 +156777,19 @@
 visibility="public"
>
</method>
<method name="onCloseSystemDialogs"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="reason" type="java.lang.String">
</parameter>
</method>
<method name="onCreateContextMenu"
 return="void"
 abstract="false"
+9 −1
Original line number Diff line number Diff line
@@ -126,13 +126,21 @@ public class ActivityInfo extends ComponentInfo
     * {@link android.R.attr#noHistory} attribute.
     */
    public static final int FLAG_NO_HISTORY = 0x0080;
    /**
     * Bit in {@link #flags} indicating that, when a request to close system
     * windows happens, this activity is finished.
     * Set from the
     * {@link android.R.attr#finishOnCloseSystemDialogs} attribute.
     */
    public static final int FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS = 0x0100;
    /**
     * Options that have been set in the activity declaration in the
     * manifest: {@link #FLAG_MULTIPROCESS},
     * {@link #FLAG_FINISH_ON_TASK_LAUNCH}, {@link #FLAG_CLEAR_TASK_ON_LAUNCH},
     * {@link #FLAG_ALWAYS_RETAIN_TASK_STATE},
     * {@link #FLAG_STATE_NOT_NEEDED}, {@link #FLAG_EXCLUDE_FROM_RECENTS},
     * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY}.
     * {@link #FLAG_ALLOW_TASK_REPARENTING}, {@link #FLAG_NO_HISTORY},
     * {@link #FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS}.
     */
    public int flags;

+6 −0
Original line number Diff line number Diff line
@@ -1658,6 +1658,12 @@ public class PackageParser {
            a.info.flags |= ActivityInfo.FLAG_ALLOW_TASK_REPARENTING;
        }

        if (sa.getBoolean(
                com.android.internal.R.styleable.AndroidManifestActivity_finishOnCloseSystemDialogs,
                false)) {
            a.info.flags |= ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
        }

        if (!receiver) {
            a.info.launchMode = sa.getInt(
                    com.android.internal.R.styleable.AndroidManifestActivity_launchMode,
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ oneway interface IWindow {
     */
    void windowFocusChanged(boolean hasFocus, boolean inTouchMode);
    
    void closeSystemDialogs(String reason);
    
    /**
     * Called for wallpaper windows when their offsets change.
     */
+2 −0
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ interface IWindowManager
    void exitKeyguardSecurely(IOnKeyguardExitResult callback);
    boolean inKeyguardRestrictedInputMode();

    void closeSystemDialogs(String reason);
    
    // These can only be called with the SET_ANIMATON_SCALE permission.
    float getAnimationScale(int which);
    float[] getAnimationScales();
Loading