Loading services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java +3 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Slog.d(TAG, "Creating virtual device with deviceId: " + deviceId); mVirtualDeviceLog.logCreated(deviceId, mOwnerUid); mPublicVirtualDeviceObject = new VirtualDevice( Loading Loading @@ -849,6 +850,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea return; } Slog.d(TAG, "Closing virtual device with deviceId: " + mDeviceId); mVirtualDeviceLog.logClosed(mDeviceId, mOwnerUid); final long ident = Binder.clearCallingIdentity(); Loading Loading @@ -902,6 +904,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea @Override public void binderDied() { Slog.d(TAG, "Binder died, closing virtual device with deviceId: " + mDeviceId); close(); } Loading services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -238,8 +238,11 @@ public class VirtualDeviceManagerService extends SystemService { CompanionDeviceManager cdm = getContext().getSystemService(CompanionDeviceManager.class); if (cdm != null) { onCdmAssociationsChanged(cdm.getAllAssociations(UserHandle.USER_ALL)); // The associations received in the callback can provide a stale state so always get // the accurate list of associations from the single source of truth cdm.addOnAssociationsChangedListener(getContext().getMainExecutor(), this::onCdmAssociationsChanged, UserHandle.USER_ALL); associations -> onCdmAssociationsChanged( cdm.getAllAssociations(UserHandle.USER_ALL)), UserHandle.USER_ALL); } else { Slog.e(TAG, "Failed to find CompanionDeviceManager. No CDM association info " + " will be available."); Loading Loading @@ -393,6 +396,8 @@ public class VirtualDeviceManagerService extends SystemService { } for (VirtualDeviceImpl virtualDevice : virtualDevicesToRemove) { Slog.d(TAG, "onCdmAssociationsChanged, removing virtual device with deviceId: " + virtualDevice.getDeviceId()); virtualDevice.close(); } Loading Loading
services/companion/java/com/android/server/companion/virtual/VirtualDeviceImpl.java +3 −0 Original line number Diff line number Diff line Loading @@ -529,6 +529,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Slog.d(TAG, "Creating virtual device with deviceId: " + deviceId); mVirtualDeviceLog.logCreated(deviceId, mOwnerUid); mPublicVirtualDeviceObject = new VirtualDevice( Loading Loading @@ -849,6 +850,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea return; } Slog.d(TAG, "Closing virtual device with deviceId: " + mDeviceId); mVirtualDeviceLog.logClosed(mDeviceId, mOwnerUid); final long ident = Binder.clearCallingIdentity(); Loading Loading @@ -902,6 +904,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub implements IBinder.Dea @Override public void binderDied() { Slog.d(TAG, "Binder died, closing virtual device with deviceId: " + mDeviceId); close(); } Loading
services/companion/java/com/android/server/companion/virtual/VirtualDeviceManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -238,8 +238,11 @@ public class VirtualDeviceManagerService extends SystemService { CompanionDeviceManager cdm = getContext().getSystemService(CompanionDeviceManager.class); if (cdm != null) { onCdmAssociationsChanged(cdm.getAllAssociations(UserHandle.USER_ALL)); // The associations received in the callback can provide a stale state so always get // the accurate list of associations from the single source of truth cdm.addOnAssociationsChangedListener(getContext().getMainExecutor(), this::onCdmAssociationsChanged, UserHandle.USER_ALL); associations -> onCdmAssociationsChanged( cdm.getAllAssociations(UserHandle.USER_ALL)), UserHandle.USER_ALL); } else { Slog.e(TAG, "Failed to find CompanionDeviceManager. No CDM association info " + " will be available."); Loading Loading @@ -393,6 +396,8 @@ public class VirtualDeviceManagerService extends SystemService { } for (VirtualDeviceImpl virtualDevice : virtualDevicesToRemove) { Slog.d(TAG, "onCdmAssociationsChanged, removing virtual device with deviceId: " + virtualDevice.getDeviceId()); virtualDevice.close(); } Loading