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

Commit 14e6c802 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Update the known CDM associations when creating a VD

In case the association was just created, VDM may have not
been notified about it yet, so calls to getAllPersistentDeviceIds
would return a wrong value.

This race also causes a tiny flakiness in some tests.

Solving by simply adding the relevant association to the known
ones when creating a VD (after verifying the association)

Fix: 436890446
Test: presubmit
Flag: EXEMPT bugfix
Change-Id: I94320f379cc9d2d8380564ac63cb3e06d9276a74
parent cb218ab9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -454,6 +454,12 @@ public class VirtualDeviceManagerService extends SystemService {
                    associationInfo.getDeviceProfile())) {
                throw new IllegalArgumentException("Unsupported CDM Association device profile "
                        + associationInfo.getDeviceProfile() + " for virtual device creation.");
            } else {
                synchronized (mVirtualDeviceManagerLock) {
                    mActiveAssociations.put(
                            VirtualDeviceImpl.createPersistentDeviceId(associationInfo.getId()),
                            associationInfo);
                }
            }
            return createVirtualDevice(token, attributionSource, associationInfo, params,
                    activityListener, soundEffectListener);