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

Commit 62900120 authored by Lenka Trochtova's avatar Lenka Trochtova
Browse files

Add throwIfParentInstance check to setMandatoryBackupTransport.

Throw SecurityException from setMandatoryBackupTransport if
in a parent instance.

BUG: 72332943
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases --test
com.android.cts.devicepolicy.ManagedProfileTest#testParentProfileApiDisabled

Change-Id: Iff2367256ce372641fd5569ad27b32f0894597ce
parent 4ce53a04
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -8733,6 +8733,7 @@ public class DevicePolicyManager {
     */
    public void setMandatoryBackupTransport(
            @NonNull ComponentName admin, @Nullable ComponentName backupTransportComponent) {
        throwIfParentInstance("setMandatoryBackupTransport");
        try {
            mService.setMandatoryBackupTransport(admin, backupTransportComponent);
        } catch (RemoteException re) {
@@ -8748,6 +8749,7 @@ public class DevicePolicyManager {
     *         mandatory or {@code null} if backups are not mandatory.
     */
    public ComponentName getMandatoryBackupTransport() {
        throwIfParentInstance("getMandatoryBackupTransport");
        try {
            return mService.getMandatoryBackupTransport();
        } catch (RemoteException re) {