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

Commit 921e8fd4 authored by Marco Loaiza's avatar Marco Loaiza
Browse files

Update deviceId when starting a service

In the cases where the top activity is running on a virtual
device and a new service is started, this service's device
association should match that of the top activity.

Test: atest DeviceAssociationTest
Bug: 253201821
Change-Id: I3be416954d1ec30ba527b399d9ba438a32f7b397
parent 9df37440
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4556,6 +4556,9 @@ public final class ActivityThread extends ClientTransactionHandler
            context.setOuterContext(service);
            service.attach(context, this, data.info.name, data.token, app,
                    ActivityManager.getService());
            if (!service.isUiContext()) { // WindowProviderService is a UI Context.
                service.updateDeviceId(mLastReportedDeviceId);
            }
            service.onCreate();
            mServicesData.put(data.token, data);
            mServices.put(data.token, service);