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

Commit bbe49187 authored by Vladimir Komsiyski's avatar Vladimir Komsiyski Committed by Android (Google) Code Review
Browse files

Merge "Require VDM device profile for CDM associations" into main

parents eb629994 094d9f02
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -92,9 +92,10 @@ class CompanionDeviceShellCommand extends ShellCommand {
                    int userId = getNextIntArgRequired();
                    String packageName = getNextArgRequired();
                    String address = getNextArgRequired();
                    String deviceProfile = getNextArg();
                    final MacAddress macAddress = MacAddress.fromString(address);
                    mService.createNewAssociation(userId, packageName, macAddress,
                            null, null, false);
                            null, deviceProfile, false);
                }
                break;

@@ -350,7 +351,7 @@ class CompanionDeviceShellCommand extends ShellCommand {
        pw.println("      Print this help text.");
        pw.println("  list USER_ID");
        pw.println("      List all Associations for a user.");
        pw.println("  associate USER_ID PACKAGE MAC_ADDRESS");
        pw.println("  associate USER_ID PACKAGE MAC_ADDRESS [DEVICE_PROFILE]");
        pw.println("      Create a new Association.");
        pw.println("  disassociate USER_ID PACKAGE MAC_ADDRESS");
        pw.println("      Remove an existing Association.");
+6 −0
Original line number Diff line number Diff line
@@ -439,6 +439,12 @@ public class VirtualDeviceManagerService extends SystemService {
            if (associationInfo == null) {
                throw new IllegalArgumentException("No association with ID " + associationId);
            }
            if (!VIRTUAL_DEVICE_COMPANION_DEVICE_PROFILES
                    .contains(associationInfo.getDeviceProfile())
                    && Flags.persistentDeviceIdApi()) {
                throw new IllegalArgumentException("Unsupported CDM Association device profile "
                        + associationInfo.getDeviceProfile() + " for virtual device creation.");
            }
            Objects.requireNonNull(params);
            Objects.requireNonNull(activityListener);
            Objects.requireNonNull(soundEffectListener);