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

Commit a1a14cb1 authored by Evan Chen's avatar Evan Chen
Browse files

Increase tag limitation to 1024

Test: atest CtsCompanionDeviceManagerCoreTestCases:AssociateTest
Fix: 295235035
Change-Id: I228467d6bd84c75dafb90a0f0a838a66c483b8a0
parent 671cd655
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ public final class CompanionDeviceManager {
     * The length limit of Association tag.
     * @hide
     */
    private static final int ASSOCIATION_TAG_LENGTH_LIMIT = 100;
    private static final int ASSOCIATION_TAG_LENGTH_LIMIT = 1024;

    /**
     * Callback for applications to receive updates about and the outcome of
@@ -1427,7 +1427,7 @@ public final class CompanionDeviceManager {
    /**
     * Sets the {@link AssociationInfo#getTag() tag} for this association.
     *
     * <p>The length of the tag must be at most 100 characters to save disk space.
     * <p>The length of the tag must be at most 1024 characters to save disk space.
     *
     * <p>This allows to store useful information about the associated devices.
     *
@@ -1441,7 +1441,8 @@ public final class CompanionDeviceManager {
        Objects.requireNonNull(tag, "tag cannot be null");

        if (tag.length() > ASSOCIATION_TAG_LENGTH_LIMIT) {
            throw new IllegalArgumentException("Length of the tag must be at most 100 characters");
            throw new IllegalArgumentException("Length of the tag must be at most"
                    + ASSOCIATION_TAG_LENGTH_LIMIT + " characters");
        }

        try {