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

Commit e95e9173 authored by Yanli Wan's avatar Yanli Wan
Browse files

Add updateLockTaskPackages API to ActivityTaskManager

The API will be available in CTS so that we can use it directly instead
of calling it from other system components.

Bug: 240602359
Test: Build & call the API from CTS
Change-Id: I8aa6ee85adb62cda67479c7213d2bc022acd0eec
parent 582bfc69
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -195,6 +195,7 @@ package android.app {
    method @RequiresPermission(android.Manifest.permission.MANAGE_ACTIVITY_TASKS) public void stopSystemLockTaskMode();
    method public static boolean supportsMultiWindow(android.content.Context);
    method public static boolean supportsSplitScreenMultiWindow(android.content.Context);
    method @RequiresPermission("android.permission.UPDATE_LOCK_TASK_PACKAGES") public void updateLockTaskPackages(@NonNull android.content.Context, @NonNull String[]);
    field public static final int DEFAULT_MINIMAL_SPLIT_SCREEN_DISPLAY_SIZE_DP = 440; // 0x1b8
    field public static final int INVALID_STACK_ID = -1; // 0xffffffff
  }
+10 −0
Original line number Diff line number Diff line
@@ -496,6 +496,16 @@ public class ActivityTaskManager {
        }
    }

    /** Update the list of packages allowed in lock task mode. */
    @RequiresPermission(android.Manifest.permission.UPDATE_LOCK_TASK_PACKAGES)
    public void updateLockTaskPackages(@NonNull Context context, @NonNull String[] packages) {
        try {
            getService().updateLockTaskPackages(context.getUserId(), packages);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Information you can retrieve about a root task in the system.
     * @hide
+1 −0
Original line number Diff line number Diff line
@@ -173,6 +173,7 @@ interface IActivityTaskManager {
    Rect getTaskBounds(int taskId);

    void cancelRecentsAnimation(boolean restoreHomeRootTaskPosition);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.UPDATE_LOCK_TASK_PACKAGES)")
    void updateLockTaskPackages(int userId, in String[] packages);
    boolean isInLockTaskMode();
    int getLockTaskModeState();
+3 −0
Original line number Diff line number Diff line
@@ -704,6 +704,9 @@
    <!-- Permission required for CTS test - CtsKeystoreTestCases -->
    <uses-permission android:name="android.permission.REQUEST_UNIQUE_ID_ATTESTATION" />

    <!-- Permission required for CTS test - CtsWindowManagerDeviceTestCases-->
    <uses-permission android:name="android.permission.UPDATE_LOCK_TASK_PACKAGES" />

    <application android:label="@string/app_label"
                android:theme="@android:style/Theme.DeviceDefault.DayNight"
                android:defaultToDeviceProtectedStorage="true"