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

Commit dbc94fd2 authored by Matías Hernández's avatar Matías Hernández Committed by Automerger Merge Worker
Browse files

Merge changes from topic "presubmit-am-a62a1375dec9427ba5398fef38c87ad3" into...

Merge changes from topic "presubmit-am-a62a1375dec9427ba5398fef38c87ad3" into sc-qpr1-dev am: f1854137 am: 5dc3e730

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22616881



Change-Id: I1dd022299fdc2220085c0df0ce31d6dcc0216a62
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 81e82906 5dc3e730
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2883,6 +2883,14 @@ public class Notification implements Parcelable
            }
        }
        if (isStyle(CallStyle.class) & extras != null) {
            Person callPerson = extras.getParcelable(EXTRA_CALL_PERSON);
            if (callPerson != null) {
                visitor.accept(callPerson.getIconUri());
            }
            visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON));
        }
        if (mBubbleMetadata != null) {
            visitIconUri(visitor, mBubbleMetadata.getIcon());
        }
+23 −0
Original line number Diff line number Diff line
@@ -5181,6 +5181,29 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        verify(visitor, times(1)).accept(eq(backgroundImage));
    }

    @Test
    public void testVisitUris_callStyle() {
        Icon personIcon = Icon.createWithContentUri("content://media/person");
        Icon verificationIcon = Icon.createWithContentUri("content://media/verification");
        Person callingPerson = new Person.Builder().setName("Someone")
                .setIcon(personIcon)
                .build();
        PendingIntent hangUpIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
                PendingIntent.FLAG_IMMUTABLE);
        Notification n = new Notification.Builder(mContext, "a")
                .setStyle(Notification.CallStyle.forOngoingCall(callingPerson, hangUpIntent)
                        .setVerificationIcon(verificationIcon))
                .setContentTitle("Calling...")
                .setSmallIcon(android.R.drawable.sym_def_app_icon)
                .build();

        Consumer<Uri> visitor = (Consumer<Uri>) spy(Consumer.class);
        n.visitUris(visitor);

        verify(visitor, times(1)).accept(eq(personIcon.getUri()));
        verify(visitor, times(1)).accept(eq(verificationIcon.getUri()));
    }

    @Test
    public void testVisitUris_audioContentsString() throws Exception {
        final Uri audioContents = Uri.parse("content://com.example/audio");