Merge "Add updateLockTaskPackages API to ActivityTaskManager"

This commit is contained in:
TreeHugger Robot
2022-09-29 20:39:30 +00:00
committed by Android (Google) Code Review
4 changed files with 15 additions and 0 deletions

View File

@@ -197,6 +197,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
}

View File

@@ -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

View File

@@ -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();

View File

@@ -705,6 +705,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"