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

Commit 6dfdfd67 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Added attribute showForAllUsers that deprecates showOnLockScreen

The new name is more meaningful to what the attribute actually does.

Also, force the FLAG_SHOWN_WHEN_LOCKED flag for windows that belong
to acitivties with the showForAllUsers attribute set.

Bug: 20227306
Change-Id: Ifd49166c3ec0e67ae43addc0fb30038523332ea5
parent 3f2631f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1098,7 +1098,8 @@ package android {
    field public static final int showAsAction = 16843481; // 0x10102d9
    field public static final int showDefault = 16843258; // 0x10101fa
    field public static final int showDividers = 16843561; // 0x1010329
    field public static final int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showForAllUsers = 16844018; // 0x10104f2
    field public static final deprecated int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showSilent = 16843259; // 0x10101fb
    field public static final int showText = 16843949; // 0x10104ad
    field public static final deprecated int showWeekNumber = 16843582; // 0x101033e
+2 −1
Original line number Diff line number Diff line
@@ -1175,7 +1175,8 @@ package android {
    field public static final int showAsAction = 16843481; // 0x10102d9
    field public static final int showDefault = 16843258; // 0x10101fa
    field public static final int showDividers = 16843561; // 0x1010329
    field public static final int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showForAllUsers = 16844018; // 0x10104f2
    field public static final deprecated int showOnLockScreen = 16843721; // 0x10103c9
    field public static final int showSilent = 16843259; // 0x10101fb
    field public static final int showText = 16843949; // 0x10104ad
    field public static final deprecated int showWeekNumber = 16843582; // 0x101033e
+4 −3
Original line number Diff line number Diff line
@@ -223,11 +223,12 @@ public class ActivityInfo extends ComponentInfo
     */
    public static final int FLAG_HARDWARE_ACCELERATED = 0x0200;
    /**
     * Value for {@link #flags}: true when the application can be displayed over the lockscreen
     * and consequently over all users' windows.
     * Value for {@link #flags}: true when the application can be displayed for all users
     * regardless of if the user of the application is the current user. Set from the
     * {@link android.R.attr#showForAllUsers} attribute.
     * @hide
     */
    public static final int FLAG_SHOW_ON_LOCK_SCREEN = 0x0400;
    public static final int FLAG_SHOW_FOR_ALL_USERS = 0x0400;
    /**
     * Bit in {@link #flags} corresponding to an immersive activity
     * that wishes not to be interrupted by notifications.
+3 −2
Original line number Diff line number Diff line
@@ -3099,8 +3099,9 @@ public class PackageParser {
            a.info.flags |= ActivityInfo.FLAG_FINISH_ON_CLOSE_SYSTEM_DIALOGS;
        }

        if (sa.getBoolean(R.styleable.AndroidManifestActivity_showOnLockScreen, false)) {
            a.info.flags |= ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN;
        if (sa.getBoolean(R.styleable.AndroidManifestActivity_showOnLockScreen, false)
                || sa.getBoolean(R.styleable.AndroidManifestActivity_showForAllUsers, false)) {
            a.info.flags |= ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
        }

        if (sa.getBoolean(R.styleable.AndroidManifestActivity_immersive, false)) {
+10 −1
Original line number Diff line number Diff line
@@ -501,9 +501,16 @@
    <attr name="excludeFromRecents" format="boolean" />

    <!-- Specify that an Activity should be shown over the lock screen and,
         in a multiuser environment, across all users' windows -->
         in a multiuser environment, across all users' windows.
         @deprecated use {@link android.R.attr#showForAllUsers} instead. -->
    <attr name="showOnLockScreen" format="boolean" />

    <!-- Specify that an Activity should be shown even if the current/foreground user
         is different from the user of the Activity. This will also force the
         <code>android.view.LayoutParams.FLAG_SHOW_WHEN_LOCKED</code> flag
         to be set for all windows of this activity -->
    <attr name="showForAllUsers" format="boolean" />

    <!-- Specify the authorities under which this content provider can be
         found.  Multiple authorities may be supplied by separating them
         with a semicolon.  Authority names should use a Java-style naming
@@ -1761,6 +1768,7 @@
        <attr name="alwaysRetainTaskState" />
        <attr name="stateNotNeeded" />
        <attr name="excludeFromRecents" />
        <!-- @deprecated use {@link android.R.attr#showForAllUsers} instead. -->
        <attr name="showOnLockScreen" />
        <!-- Specify whether the activity is enabled or not (that is, can be instantiated by the system).
             It can also be specified for an application as a whole, in which case a value of "false"
@@ -1789,6 +1797,7 @@
        <attr name="resumeWhilePausing" />
        <attr name="resizeableActivity" />
        <attr name="lockTaskMode" />
        <attr name="showForAllUsers" />
    </declare-styleable>

    <!-- The <code>activity-alias</code> tag declares a new
Loading