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

Commit 3b391a78 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski
Browse files

Expose the public VD from VDMInternal

Bug: 396422648
Change-Id: I1378cedb19ecf1c9895416fbf59e3b2c38b224a7
Test: presubmit
Flag: EXEMPT no-op
parent 05e684c4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -890,6 +890,11 @@ public class VirtualDeviceManagerService extends SystemService {
            return mImpl.getDeviceIdForDisplayId(displayId);
        }

        @Override
        public VirtualDevice getVirtualDevice(int deviceId) {
            return mImpl.getVirtualDevice(deviceId);
        }

        @Override
        public long getDimDurationMillisForDeviceId(int deviceId) {
            VirtualDeviceImpl virtualDevice = getVirtualDeviceForId(deviceId);
+16 −0
Original line number Diff line number Diff line
@@ -211,4 +211,20 @@ public abstract class VirtualDeviceManagerInternal {
     */
    public abstract @NonNull VirtualDeviceManager.VirtualDevice createVirtualDevice(
            @NonNull VirtualDeviceParams params);

    /**
     * Returns the details of the virtual device with the given ID, if any.
     *
     * <p>The returned object is a read-only representation of the virtual device that expose its
     * properties.</p>
     *
     * <p>Note that if the virtual device is closed and becomes invalid, the returned object will
     * not be updated and may contain stale values. Use a {@link VirtualDeviceListener} for real
     * time updates of the availability of virtual devices.</p>
     *
     * @return the virtual device with the requested ID, or {@code null} if no such device exists or
     *   it has already been closed.
     */
    @Nullable
    public abstract VirtualDevice getVirtualDevice(int deviceId);
}