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

Commit c3696eff authored by Jason Parks's avatar Jason Parks Committed by Android (Google) Code Review
Browse files

Merge "Make the new setSecondaryLockscreen a SystemApi" into main

parents 72eacf64 e50a448b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1378,7 +1378,8 @@ package android.app.admin {
    method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setDpcDownloaded(boolean);
    method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setMaxPolicyStorageLimit(int);
    method @Deprecated @RequiresPermission(value=android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS, conditional=true) public void setProfileOwnerCanAccessDeviceIds(@NonNull android.content.ComponentName);
    method public void setSecondaryLockscreenEnabled(@NonNull android.content.ComponentName, boolean);
    method @Deprecated @FlaggedApi("android.app.admin.flags.secondary_lockscreen_api_enabled") public void setSecondaryLockscreenEnabled(@NonNull android.content.ComponentName, boolean);
    method @FlaggedApi("android.app.admin.flags.secondary_lockscreen_api_enabled") public void setSecondaryLockscreenEnabled(boolean, @Nullable android.os.PersistableBundle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setUserProvisioningState(int, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public boolean shouldAllowBypassingDevicePolicyManagementRoleQualification();
    field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED";
+22 −6
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ import static android.app.admin.flags.Flags.FLAG_DEVICE_THEFT_API_ENABLED;
import static android.app.admin.flags.Flags.FLAG_REMOVE_MANAGED_PROFILE_ENABLED;
import static android.app.admin.flags.Flags.onboardingBugreportV2Enabled;
import static android.app.admin.flags.Flags.onboardingConsentlessBugreports;
import static android.app.admin.flags.Flags.FLAG_SECONDARY_LOCKSCREEN_API_ENABLED;
import static android.content.Intent.LOCAL_FLAG_FROM_SYSTEM;
import static android.net.NetworkCapabilities.NET_ENTERPRISE_ID_1;
import static android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
@@ -12642,28 +12643,43 @@ public class DevicePolicyManager {
     * @param enabled Whether or not the lockscreen needs to be shown.
     * @throws SecurityException if {@code admin} is not a device or profile owner.
     * @see #isSecondaryLockscreenEnabled
     * @deprecated Use {@link #setSecondaryLockscreenEnabled(boolean,PersistableBundle)} instead.
     * @hide
     **/
     */
    @Deprecated
    @SystemApi
    @FlaggedApi(FLAG_SECONDARY_LOCKSCREEN_API_ENABLED)
    public void setSecondaryLockscreenEnabled(@NonNull ComponentName admin, boolean enabled) {
        setSecondaryLockscreenEnabled(admin, enabled, null);
        throwIfParentInstance("setSecondaryLockscreenEnabled");
        if (mService != null) {
            try {
                mService.setSecondaryLockscreenEnabled(admin, enabled, null);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
        }
    }
    /**
     * Called by the system supervision app to set whether a secondary lockscreen needs to be shown.
     *
     * @param admin Which {@link DeviceAdminReceiver} this request is associated with. Null if the
     *              caller is not a device admin.
     * <p>The secondary lockscreen will by displayed after the primary keyguard security screen
     * requirements are met.
     *
     * <p>This API, and associated APIs, can only be called by the default supervision app.
     *
     * @param enabled Whether or not the lockscreen needs to be shown.
     * @param options A {@link PersistableBundle} to supply options to the lock screen.
     * @hide
     */
    public void setSecondaryLockscreenEnabled(@Nullable ComponentName admin, boolean enabled,
    @SystemApi
    @FlaggedApi(FLAG_SECONDARY_LOCKSCREEN_API_ENABLED)
    public void setSecondaryLockscreenEnabled(boolean enabled,
            @Nullable PersistableBundle options) {
        throwIfParentInstance("setSecondaryLockscreenEnabled");
        if (mService != null) {
            try {
                mService.setSecondaryLockscreenEnabled(admin, enabled, options);
                mService.setSecondaryLockscreenEnabled(null, enabled, options);
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
+8 −0
Original line number Diff line number Diff line
@@ -381,3 +381,11 @@ flag {
  description: "Split up existing create and provision managed profile API."
  bug: "375382324"
}

flag {
  name: "secondary_lockscreen_api_enabled"
  is_exported: true
  namespace: "enterprise"
  description: "Add new API for secondary lockscreen"
  bug: "336297680"
}