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

Commit a928f327 authored by Evan Chen's avatar Evan Chen Committed by Android Build Coastguard Worker
Browse files

Limit the tag length to 1024

Bug: 386802855
Test: cts
Flag: EXEMPT test fix
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1bea5725035b62fda3f1f2f3d68447bf8b159ced)
Merged-In: I7adae8cd57b26e0e9a27d68c49c2de68fd952afd
Change-Id: I7adae8cd57b26e0e9a27d68c49c2de68fd952afd
parent cb4d4f3c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -714,6 +714,10 @@ public class CompanionDeviceManagerService extends SystemService {

        @Override
        public void setAssociationTag(int associationId, String tag) {
            if (tag.length() > 1024) {
                throw new IllegalArgumentException("Length of the tag must be at most"
                    + 1024 + " characters");
        }
            mAssociationRequestsProcessor.setAssociationTag(associationId, tag);
        }