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

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

Merge "Add options bundle to setSecondaryLockscreenEnabled" into main

parents 8c920c1d f01c5e2e
Loading
Loading
Loading
Loading
+15 −1
Original line number Original line Diff line number Diff line
@@ -12572,10 +12572,24 @@ public class DevicePolicyManager {
     **/
     **/
    @SystemApi
    @SystemApi
    public void setSecondaryLockscreenEnabled(@NonNull ComponentName admin, boolean enabled) {
    public void setSecondaryLockscreenEnabled(@NonNull ComponentName admin, boolean enabled) {
        setSecondaryLockscreenEnabled(admin, enabled, null);
    }
    /**
     * 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.
     * @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,
            @Nullable PersistableBundle options) {
        throwIfParentInstance("setSecondaryLockscreenEnabled");
        throwIfParentInstance("setSecondaryLockscreenEnabled");
        if (mService != null) {
        if (mService != null) {
            try {
            try {
                mService.setSecondaryLockscreenEnabled(admin, enabled);
                mService.setSecondaryLockscreenEnabled(admin, enabled, options);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowFromSystemServer();
            }
            }
+1 −1
Original line number Original line Diff line number Diff line
@@ -303,7 +303,7 @@ interface IDevicePolicyManager {
    String[] getAccountTypesWithManagementDisabled(String callerPackageName);
    String[] getAccountTypesWithManagementDisabled(String callerPackageName);
    String[] getAccountTypesWithManagementDisabledAsUser(int userId, String callerPackageName, in boolean parent);
    String[] getAccountTypesWithManagementDisabledAsUser(int userId, String callerPackageName, in boolean parent);


    void setSecondaryLockscreenEnabled(in ComponentName who, boolean enabled);
    void setSecondaryLockscreenEnabled(in ComponentName who, boolean enabled, in PersistableBundle options);
    boolean isSecondaryLockscreenEnabled(in UserHandle userHandle);
    boolean isSecondaryLockscreenEnabled(in UserHandle userHandle);


    void setPreferentialNetworkServiceConfigs(
    void setPreferentialNetworkServiceConfigs(
+2 −1
Original line number Original line Diff line number Diff line
@@ -14799,7 +14799,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }
    }
    @Override
    @Override
    public void setSecondaryLockscreenEnabled(ComponentName who, boolean enabled) {
    public void setSecondaryLockscreenEnabled(ComponentName who, boolean enabled,
            PersistableBundle options) {
        Objects.requireNonNull(who, "ComponentName is null");
        Objects.requireNonNull(who, "ComponentName is null");
        // Check can set secondary lockscreen enabled
        // Check can set secondary lockscreen enabled