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

Commit 751cbc64 authored by Benjamin Franz's avatar Benjamin Franz Committed by Android (Google) Code Review
Browse files

Merge "Update lock task features name and javadoc"

parents 69ad4a15 caffa778
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4070,7 +4070,7 @@ package android.app {
    method public android.app.ActivityOptions setAppVerificationBundle(android.os.Bundle);
    method public android.app.ActivityOptions setLaunchBounds(android.graphics.Rect);
    method public android.app.ActivityOptions setLaunchDisplayId(int);
    method public android.app.ActivityOptions setLockTaskMode(boolean);
    method public android.app.ActivityOptions setLockTaskEnabled(boolean);
    method public android.os.Bundle toBundle();
    method public void update(android.app.ActivityOptions);
    field public static final java.lang.String EXTRA_USAGE_TIME_REPORT = "android.activity.usage_time";
@@ -6678,7 +6678,7 @@ package android.app.admin {
    field public static final int LOCK_TASK_FEATURE_KEYGUARD = 32; // 0x20
    field public static final int LOCK_TASK_FEATURE_NONE = 0; // 0x0
    field public static final int LOCK_TASK_FEATURE_NOTIFICATIONS = 2; // 0x2
    field public static final int LOCK_TASK_FEATURE_RECENTS = 8; // 0x8
    field public static final int LOCK_TASK_FEATURE_OVERVIEW = 8; // 0x8
    field public static final int LOCK_TASK_FEATURE_SYSTEM_INFO = 1; // 0x1
    field public static final int MAKE_USER_EPHEMERAL = 2; // 0x2
    field public static final java.lang.String MIME_TYPE_PROVISIONING_NFC = "application/com.android.managedprovisioning";
+2 −2
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ public class ActivityOptions {

    /**
     * Whether the activity should be launched into LockTask mode.
     * @see #setLockTaskMode(boolean)
     * @see #setLockTaskEnabled(boolean)
     */
    private static final String KEY_LOCK_TASK_MODE = "android:activity.lockTaskMode";

@@ -1148,7 +1148,7 @@ public class ActivityOptions {
     * @see Activity#startLockTask()
     * @see android.app.admin.DevicePolicyManager#setLockTaskPackages(ComponentName, String[])
     */
    public ActivityOptions setLockTaskMode(boolean lockTaskMode) {
    public ActivityOptions setLockTaskEnabled(boolean lockTaskMode) {
        mLockTaskMode = lockTaskMode;
        return this;
    }
+8 −4
Original line number Diff line number Diff line
@@ -1646,11 +1646,15 @@ public class DevicePolicyManager {
    public static final int LOCK_TASK_FEATURE_HOME = 1 << 2;

    /**
     * Enable the Recents button and the Recents screen during LockTask mode.
     * Enable the Overview button and the Overview screen during LockTask mode. This feature flag
     * can only be used in combination with {@link #LOCK_TASK_FEATURE_HOME}, and
     * {@link #setLockTaskFeatures(ComponentName, int)} will throw an
     * {@link IllegalArgumentException} if this feature flag is defined without
     * {@link #LOCK_TASK_FEATURE_HOME}.
     *
     * @see #setLockTaskFeatures(ComponentName, int)
     */
    public static final int LOCK_TASK_FEATURE_RECENTS = 1 << 3;
    public static final int LOCK_TASK_FEATURE_OVERVIEW = 1 << 3;

    /**
     * Enable the global actions dialog during LockTask mode. This is the dialog that shows up when
@@ -1682,7 +1686,7 @@ public class DevicePolicyManager {
            LOCK_TASK_FEATURE_SYSTEM_INFO,
            LOCK_TASK_FEATURE_NOTIFICATIONS,
            LOCK_TASK_FEATURE_HOME,
            LOCK_TASK_FEATURE_RECENTS,
            LOCK_TASK_FEATURE_OVERVIEW,
            LOCK_TASK_FEATURE_GLOBAL_ACTIONS,
            LOCK_TASK_FEATURE_KEYGUARD
    })
@@ -7193,7 +7197,7 @@ public class DevicePolicyManager {
     *              {@link #LOCK_TASK_FEATURE_SYSTEM_INFO},
     *              {@link #LOCK_TASK_FEATURE_NOTIFICATIONS},
     *              {@link #LOCK_TASK_FEATURE_HOME},
     *              {@link #LOCK_TASK_FEATURE_RECENTS},
     *              {@link #LOCK_TASK_FEATURE_OVERVIEW},
     *              {@link #LOCK_TASK_FEATURE_GLOBAL_ACTIONS},
     *              {@link #LOCK_TASK_FEATURE_KEYGUARD}
     * @throws SecurityException if {@code admin} is not the device owner, the profile owner of an
+1 −2
Original line number Diff line number Diff line
@@ -442,12 +442,11 @@ final class ActivityManagerShellCommand extends ShellCommand {
                    options.setTaskOverlay(true, true /* canResume */);
                }
            }
            android.util.Log.d("bfranz", "I was here: " + mIsLockTask);
            if (mIsLockTask) {
                if (options == null) {
                    options = ActivityOptions.makeBasic();
                }
                options.setLockTaskMode(true);
                options.setLockTaskEnabled(true);
            }
            if (mWaitOption) {
                result = mInterface.startActivityAndWait(null, null, intent, mimeType,
+2 −3
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_LAUNCHABLE_PRIV;
import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_PINNABLE;
import static com.android.server.am.TaskRecord.LOCK_TASK_AUTH_WHITELISTED;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Activity;
@@ -114,7 +113,7 @@ public class LockTaskController {
        STATUS_BAR_FLAG_MAP_LOCKED.append(DevicePolicyManager.LOCK_TASK_FEATURE_HOME,
                new Pair<>(StatusBarManager.DISABLE_HOME, StatusBarManager.DISABLE2_NONE));

        STATUS_BAR_FLAG_MAP_LOCKED.append(DevicePolicyManager.LOCK_TASK_FEATURE_RECENTS,
        STATUS_BAR_FLAG_MAP_LOCKED.append(DevicePolicyManager.LOCK_TASK_FEATURE_OVERVIEW,
                new Pair<>(StatusBarManager.DISABLE_RECENT, StatusBarManager.DISABLE2_NONE));

        STATUS_BAR_FLAG_MAP_LOCKED.append(DevicePolicyManager.LOCK_TASK_FEATURE_GLOBAL_ACTIONS,
@@ -308,7 +307,7 @@ public class LockTaskController {

    private boolean isRecentsAllowed(int userId) {
        return (getLockTaskFeaturesForUser(userId)
                & DevicePolicyManager.LOCK_TASK_FEATURE_RECENTS) != 0;
                & DevicePolicyManager.LOCK_TASK_FEATURE_OVERVIEW) != 0;
    }

    private boolean isKeyguardAllowed(int userId) {
Loading