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

Commit eb4c26ec authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Avoid infinite blocked loop in VDM

when the BlockedAppStreamingActivity is itself blocked

Bug: 347694416
Change-Id: I903943ec1077186eafaca7430ac2f62aab00088a
Flag: EXEMPT bugfix
Test: presubmit
parent ff099c24
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1349,14 +1349,14 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub

    private boolean shouldShowBlockedActivityDialog(ComponentName blockedComponent,
            ComponentName blockedAppStreamingActivityComponent) {
        if (!android.companion.virtualdevice.flags.Flags.activityControlApi()) {
            return true;
        }
        if (Objects.equals(blockedComponent, blockedAppStreamingActivityComponent)) {
            // Do not show the dialog if it was blocked for some reason already to avoid
            // infinite blocking loop.
            return false;
        }
        if (!android.companion.virtualdevice.flags.Flags.activityControlApi()) {
            return true;
        }
        // Do not show the dialog if disabled by policy.
        return getDevicePolicy(POLICY_TYPE_BLOCKED_ACTIVITY_BEHAVIOR) == DEVICE_POLICY_DEFAULT;
    }