Fix guts are not bound properly.
When binding importance to guts, applying findViewById to ExpandableNotificationRow of group's parents could cause to return the reference of child notications's guts which also has the same id. As a result guts are not bound properly, and show weird guts. Fixes: 29452827 Change-Id: Iaf8ee74b988bf41680857e9c3c3ae9e3bd8e4e1b
This commit is contained in:
@@ -1083,8 +1083,8 @@ public abstract class BaseStatusBar extends SystemUI implements
|
||||
pkgicon = pmUser.getDefaultActivityIcon();
|
||||
}
|
||||
|
||||
((ImageView) row.findViewById(R.id.app_icon)).setImageDrawable(pkgicon);
|
||||
((TextView) row.findViewById(R.id.pkgname)).setText(appname);
|
||||
((ImageView) guts.findViewById(R.id.app_icon)).setImageDrawable(pkgicon);
|
||||
((TextView) guts.findViewById(R.id.pkgname)).setText(appname);
|
||||
|
||||
final View settingsButton = guts.findViewById(R.id.more_settings);
|
||||
if (appUid >= 0) {
|
||||
@@ -1100,8 +1100,9 @@ public abstract class BaseStatusBar extends SystemUI implements
|
||||
settingsButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
guts.bindImportance(pmUser, sbn, row, mNotificationData.getImportance(sbn.getKey()));
|
||||
row.findViewById(R.id.done).setOnClickListener(new View.OnClickListener() {
|
||||
guts.bindImportance(pmUser, sbn, mNotificationData.getImportance(sbn.getKey()));
|
||||
|
||||
guts.findViewById(R.id.done).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
// If the user has security enabled, show challenge if the setting is changed.
|
||||
|
||||
@@ -173,7 +173,7 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab
|
||||
}
|
||||
|
||||
void bindImportance(final PackageManager pm, final StatusBarNotification sbn,
|
||||
final ExpandableNotificationRow row, final int importance) {
|
||||
final int importance) {
|
||||
mINotificationManager = INotificationManager.Stub.asInterface(
|
||||
ServiceManager.getService(Context.NOTIFICATION_SERVICE));
|
||||
mStartingUserImportance = NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED;
|
||||
@@ -191,8 +191,8 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab
|
||||
// unlikely.
|
||||
}
|
||||
|
||||
final View importanceSlider = row.findViewById(R.id.importance_slider);
|
||||
final View importanceButtons = row.findViewById(R.id.importance_buttons);
|
||||
final View importanceSlider = findViewById(R.id.importance_slider);
|
||||
final View importanceButtons = findViewById(R.id.importance_buttons);
|
||||
if (mShowSlider) {
|
||||
bindSlider(importanceSlider, systemApp);
|
||||
importanceSlider.setVisibility(View.VISIBLE);
|
||||
|
||||
Reference in New Issue
Block a user