Skip to content

Commit 373a4f4

Browse files
jsharkeyAndroid (Google) Code Review
authored andcommitted
Merge "Make large_icon in notification catch touches."
2 parents fead8f9 + 847fd75 commit 373a4f4

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

packages/SystemUI/res/layout/status_bar_notification_row.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
android:layout_alignParentTop="true"
2323
android:layout_alignParentLeft="true"
2424
android:scaleType="center"
25+
android:clickable="true"
2526
/>
2627

2728
<com.android.systemui.statusbar.LatestItemView android:id="@+id/content"

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,12 @@ public void updateNotification(IBinder key, StatusBarNotification notification)
662662
// update the contentIntent
663663
final PendingIntent contentIntent = notification.notification.contentIntent;
664664
if (contentIntent != null) {
665-
oldEntry.content.setOnClickListener(new NotificationClicker(contentIntent,
666-
notification.pkg, notification.tag, notification.id));
665+
final View.OnClickListener listener = new NotificationClicker(contentIntent,
666+
notification.pkg, notification.tag, notification.id);
667+
oldEntry.largeIcon.setOnClickListener(listener);
668+
oldEntry.content.setOnClickListener(listener);
667669
} else {
670+
oldEntry.largeIcon.setOnClickListener(null);
668671
oldEntry.content.setOnClickListener(null);
669672
}
670673
// Update the icon.
@@ -779,9 +782,12 @@ public void onClick(View v) {
779782
content.setOnFocusChangeListener(mFocusChangeListener);
780783
PendingIntent contentIntent = n.contentIntent;
781784
if (contentIntent != null) {
782-
content.setOnClickListener(new NotificationClicker(contentIntent, notification.pkg,
783-
notification.tag, notification.id));
785+
final View.OnClickListener listener = new NotificationClicker(contentIntent,
786+
notification.pkg, notification.tag, notification.id);
787+
largeIcon.setOnClickListener(listener);
788+
content.setOnClickListener(listener);
784789
} else {
790+
largeIcon.setOnClickListener(null);
785791
content.setOnClickListener(null);
786792
}
787793

@@ -979,9 +985,12 @@ public void onClick(View v) {
979985
// content.setOnFocusChangeListener(mFocusChangeListener);
980986
PendingIntent contentIntent = sbn.notification.contentIntent;
981987
if (contentIntent != null) {
982-
content.setOnClickListener(new NotificationClicker(contentIntent,
983-
sbn.pkg, sbn.tag, sbn.id));
988+
final View.OnClickListener listener = new NotificationClicker(contentIntent,
989+
sbn.pkg, sbn.tag, sbn.id);
990+
largeIcon.setOnClickListener(listener);
991+
content.setOnClickListener(listener);
984992
} else {
993+
largeIcon.setOnClickListener(null);
985994
content.setOnClickListener(null);
986995
}
987996

packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,12 @@ public void updateNotification(IBinder key, StatusBarNotification notification)
838838
// update the contentIntent
839839
final PendingIntent contentIntent = notification.notification.contentIntent;
840840
if (contentIntent != null) {
841-
oldEntry.content.setOnClickListener(new NotificationClicker(contentIntent,
842-
notification.pkg, notification.tag, notification.id));
841+
final View.OnClickListener listener = new NotificationClicker(contentIntent,
842+
notification.pkg, notification.tag, notification.id);
843+
oldEntry.largeIcon.setOnClickListener(listener);
844+
oldEntry.content.setOnClickListener(listener);
843845
} else {
846+
oldEntry.largeIcon.setOnClickListener(null);
844847
oldEntry.content.setOnClickListener(null);
845848
}
846849
// Update the icon.
@@ -1766,9 +1769,12 @@ public void onClick(View v) {
17661769
// content.setOnFocusChangeListener(mFocusChangeListener);
17671770
PendingIntent contentIntent = sbn.notification.contentIntent;
17681771
if (contentIntent != null) {
1769-
content.setOnClickListener(new NotificationClicker(contentIntent,
1770-
sbn.pkg, sbn.tag, sbn.id));
1772+
final View.OnClickListener listener = new NotificationClicker(
1773+
contentIntent, sbn.pkg, sbn.tag, sbn.id);
1774+
largeIcon.setOnClickListener(listener);
1775+
content.setOnClickListener(listener);
17711776
} else {
1777+
largeIcon.setOnClickListener(null);
17721778
content.setOnClickListener(null);
17731779
}
17741780

0 commit comments

Comments
 (0)