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

Commit b7a1e303 authored by Biswarup Pal's avatar Biswarup Pal Committed by Android (Google) Code Review
Browse files

Merge changes from topics "vdm-mirror-1", "vdm-mirror-icon" into main

* changes:
  Show status bar icon during VDM screen mirroring
  VDM interactive screen mirroring
parents 230be515 7e0a903a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -866,6 +866,14 @@ package android.companion {

}

package android.companion.virtual {

  public final class VirtualDeviceManager {
    method @FlaggedApi("android.companion.virtual.flags.interactive_screen_mirror") public boolean isVirtualDeviceOwnedMirrorDisplay(int);
  }

}

package android.content {

  public final class AttributionSource implements android.os.Parcelable {
+6 −0
Original line number Diff line number Diff line
@@ -122,4 +122,10 @@ interface IVirtualDeviceManager {
     *   {@code android.media.AudioManager.SystemSoundEffect}
     */
    void playSoundEffect(int deviceId, int effectType);

    /**
     * Returns whether the given display is an auto-mirror display owned by a virtual
     * device.
     */
    boolean isVirtualDeviceOwnedMirrorDisplay(int displayId);
}
+20 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.UserIdInt;
import android.app.PendingIntent;
import android.companion.AssociationInfo;
@@ -435,6 +436,25 @@ public final class VirtualDeviceManager {
        }
    }

    /**
     * Returns whether the given display is an auto-mirror display owned by a virtual device.
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_INTERACTIVE_SCREEN_MIRROR)
    @TestApi
    public boolean isVirtualDeviceOwnedMirrorDisplay(int displayId) {
        if (mService == null) {
            Log.w(TAG, "Failed to retrieve virtual devices; no virtual device manager service.");
            return false;
        }
        try {
            return mService.isVirtualDeviceOwnedMirrorDisplay(displayId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * A representation of a virtual device.
     *
+7 −0
Original line number Diff line number Diff line
@@ -56,3 +56,10 @@ flag {
  description: "Enable express metrics in VDM"
  bug: "307297730"
}

flag {
  name: "interactive_screen_mirror"
  namespace: "virtual_devices"
  description: "Enable interactive screen mirroring using Virtual Devices"
  bug: "292212199"
}
+7 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import android.app.smartspace.SmartspaceManager;
import android.app.trust.TrustManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.companion.virtual.VirtualDeviceManager;
import android.content.ClipboardManager;
import android.content.ContentResolver;
import android.content.Context;
@@ -234,6 +235,12 @@ public class FrameworkServicesModule {
        return context.getSystemService(DisplayManager.class);
    }

    @Provides
    @Singleton
    static VirtualDeviceManager provideVirtualDeviceManager(Context context) {
        return context.getSystemService(VirtualDeviceManager.class);
    }

    @Provides
    @Singleton
    static DeviceStateManager provideDeviceStateManager(Context context) {
Loading