AOD: Fix in-place ambient layout updates

Change-Id: I7863bd5690476b76456182ee37527548f4acb54d
Fixes: 34734890
Test: Post notification, post update to notification, enter ambient display, observe that ambient display is up to date.
This commit is contained in:
Adrian Roos
2017-01-26 16:09:26 -08:00
parent dacf5e522e
commit 95d3aa3173
2 changed files with 9 additions and 0 deletions

View File

@@ -121,6 +121,10 @@ public class NotificationData {
return row.getPublicLayout().getContractedChild();
}
public View getAmbientContentView() {
return row.getPrivateLayout().getAmbientChild();
}
public boolean cacheContentViews(Context ctx, Notification updatedNotification,
boolean isLowPriority) {
boolean applyInPlace = false;

View File

@@ -7019,6 +7019,7 @@ public class StatusBar extends SystemUI implements DemoMode,
final RemoteViews bigContentView = entry.cachedBigContentView;
final RemoteViews headsUpContentView = entry.cachedHeadsUpContentView;
final RemoteViews publicContentView = entry.cachedPublicContentView;
final RemoteViews ambientContentView = entry.cachedAmbientContentView;
// Reapply the RemoteViews
contentView.reapply(mContext, entry.getContentView(), mOnClickHandler);
@@ -7036,6 +7037,10 @@ public class StatusBar extends SystemUI implements DemoMode,
publicContentView.reapply(sbn.getPackageContext(mContext),
entry.getPublicContentView(), mOnClickHandler);
}
if (ambientContentView != null && entry.getAmbientContentView() != null) {
ambientContentView.reapply(sbn.getPackageContext(mContext),
entry.getAmbientContentView(), mOnClickHandler);
}
// update the contentIntent
mNotificationClicker.register(entry.row, sbn);