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

Commit 30cd1ea7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/33622976',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/33622976', 'googleplex-android-review.googlesource.com/33628917', 'googleplex-android-review.googlesource.com/33604250', 'googleplex-android-review.googlesource.com/33684829', 'googleplex-android-review.googlesource.com/33659562', 'googleplex-android-review.googlesource.com/33659561', 'googleplex-android-review.googlesource.com/33921177', 'googleplex-android-review.googlesource.com/33669223', 'googleplex-android-review.googlesource.com/33938031', 'googleplex-android-review.googlesource.com/33670089', 'googleplex-android-review.googlesource.com/33691056', 'googleplex-android-review.googlesource.com/34125953', 'googleplex-android-review.googlesource.com/34109857', 'googleplex-android-review.googlesource.com/34261836', 'googleplex-android-review.googlesource.com/34261140', 'googleplex-android-review.googlesource.com/34128041', 'googleplex-android-review.googlesource.com/33915868', 'googleplex-android-review.googlesource.com/33918768', 'googleplex-android-review.googlesource.com/34080956', 'googleplex-android-review.googlesource.com/34244300', 'googleplex-android-review.googlesource.com/34379480', 'googleplex-android-review.googlesource.com/34261542'] into 25Q2-release.

Change-Id: I848dee9fee5881f250df43826d181f33d63a9a15
parents 7ec407e8 dee86220
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -650,7 +650,7 @@ public final class NotificationChannel implements Parcelable {
     * @hide
     */
    public void setId(String id) {
        mId = id;
        mId = getTrimmedString(id);
    }

    // Modifiable by apps on channel creation.
@@ -894,8 +894,8 @@ public final class NotificationChannel implements Parcelable {
     */
    public void setConversationId(@NonNull String parentChannelId,
            @NonNull String conversationId) {
        mParentId = parentChannelId;
        mConversationId = conversationId;
        mParentId = getTrimmedString(parentChannelId);
        mConversationId = getTrimmedString(conversationId);
    }

    /**
+2 −0
Original line number Diff line number Diff line
@@ -409,6 +409,8 @@ public final class DeviceAdminInfo implements Parcelable {
        } catch (NameNotFoundException e) {
            throw new XmlPullParserException(
                    "Unable to create context for: " + mActivityInfo.packageName);
        } catch (OutOfMemoryError e) {
            throw new XmlPullParserException("Out of memory when parsing", null, e);
        } finally {
            if (parser != null) parser.close();
        }
+7 −0
Original line number Diff line number Diff line
@@ -274,6 +274,8 @@ public final class AssociationRequest implements Parcelable {
     */
    private boolean mSkipPrompt;

    private static final int DISPLAY_NAME_LENGTH_LIMIT = 1024;

    /**
     * The device icon displayed in selfManaged association dialog.
     * @hide
@@ -501,6 +503,11 @@ public final class AssociationRequest implements Parcelable {
        public Builder setDisplayName(@NonNull CharSequence displayName) {
            checkNotUsed();
            mDisplayName = requireNonNull(displayName);
            if (displayName.length() > DISPLAY_NAME_LENGTH_LIMIT) {
                throw new IllegalArgumentException("Length of the display name must be at most "
                        + DISPLAY_NAME_LENGTH_LIMIT + " characters");
            }

            return this;
        }

+30 −0
Original line number Diff line number Diff line
@@ -255,6 +255,36 @@ public class NotificationChannelTest {
                fromParcel.getSound().toString().length());
    }

    @Test
    public void testSetId_longStringIsTrimmed() {
        NotificationChannel channel =
                new NotificationChannel("id", "name", NotificationManager.IMPORTANCE_DEFAULT);
        String longId = Strings.repeat("A", NotificationChannel.MAX_TEXT_LENGTH + 10);

        channel.setId(longId);

        assertThat(channel.getId()).hasLength(NotificationChannel.MAX_TEXT_LENGTH);
        assertThat(channel.getId())
                .isEqualTo(longId.substring(0, NotificationChannel.MAX_TEXT_LENGTH));
    }

    @Test
    public void testSetConversationId_longStringsAreTrimmed() {
        NotificationChannel channel =
                new NotificationChannel("id", "name", NotificationManager.IMPORTANCE_DEFAULT);
        String longParentId = Strings.repeat("P", NotificationChannel.MAX_TEXT_LENGTH + 10);
        String longConversationId = Strings.repeat("C", NotificationChannel.MAX_TEXT_LENGTH + 10);

        channel.setConversationId(longParentId, longConversationId);

        assertThat(channel.getParentChannelId()).hasLength(NotificationChannel.MAX_TEXT_LENGTH);
        assertThat(channel.getParentChannelId())
                .isEqualTo(longParentId.substring(0, NotificationChannel.MAX_TEXT_LENGTH));
        assertThat(channel.getConversationId()).hasLength(NotificationChannel.MAX_TEXT_LENGTH);
        assertThat(channel.getConversationId())
                .isEqualTo(longConversationId.substring(0, NotificationChannel.MAX_TEXT_LENGTH));
    }

    @Test
    @EnableFlags({Flags.FLAG_NOTIFICATION_CHANNEL_VIBRATION_EFFECT_API,
            Flags.FLAG_NOTIF_CHANNEL_CROP_VIBRATION_EFFECTS})
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ public final class RemotePrintDocument {
        try {
            file = mDocumentInfo.fileProvider.acquireFile(null);
            in = new FileInputStream(file);
            out = contentResolver.openOutputStream(uri);
            out = contentResolver.openOutputStream(uri, "wt");
            final byte[] buffer = new byte[8192];
            while (true) {
                final int readByteCount = in.read(buffer);
Loading