Merge "Fixed a test for app ops icons" into rvc-dev am: 0c33b0a842

Change-Id: I1a2d54ce48b6be26fd1bf83512bcf3c3a3c674a5
This commit is contained in:
Selim Cinek
2020-04-03 20:03:46 +00:00
committed by Automerger Merge Worker
2 changed files with 15 additions and 7 deletions

View File

@@ -130,10 +130,18 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
if (mNotificationHeader != null) { if (mNotificationHeader != null) {
mNotificationHeader.setAppOpsOnClickListener(listener); mNotificationHeader.setAppOpsOnClickListener(listener);
} }
mAppOps.setOnClickListener(listener); if (mAppOps != null) {
mCameraIcon.setOnClickListener(listener); mAppOps.setOnClickListener(listener);
mMicIcon.setOnClickListener(listener); }
mOverlayIcon.setOnClickListener(listener); if (mCameraIcon != null) {
mCameraIcon.setOnClickListener(listener);
}
if (mMicIcon != null) {
mMicIcon.setOnClickListener(listener);
}
if (mOverlayIcon != null) {
mOverlayIcon.setOnClickListener(listener);
}
} }
/** /**

View File

@@ -76,13 +76,13 @@ public class NotificationContentViewTest extends SysuiTestCase {
@Test @Test
@UiThreadTest @UiThreadTest
public void testShowAppOpsIcons() { public void testShowAppOpsIcons() {
View mockContracted = mock(View.class); View mockContracted = mock(NotificationHeaderView.class);
when(mockContracted.findViewById(com.android.internal.R.id.mic)) when(mockContracted.findViewById(com.android.internal.R.id.mic))
.thenReturn(mockContracted); .thenReturn(mockContracted);
View mockExpanded = mock(View.class); View mockExpanded = mock(NotificationHeaderView.class);
when(mockExpanded.findViewById(com.android.internal.R.id.mic)) when(mockExpanded.findViewById(com.android.internal.R.id.mic))
.thenReturn(mockExpanded); .thenReturn(mockExpanded);
View mockHeadsUp = mock(View.class); View mockHeadsUp = mock(NotificationHeaderView.class);
when(mockHeadsUp.findViewById(com.android.internal.R.id.mic)) when(mockHeadsUp.findViewById(com.android.internal.R.id.mic))
.thenReturn(mockHeadsUp); .thenReturn(mockHeadsUp);