Merge "Add traces to the main thread inflation of NotificationHeaderView and HybridNotificationView" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
8386f84761
@@ -556,6 +556,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onNotificationUpdated() {
|
public void onNotificationUpdated() {
|
||||||
|
if (mIsSummaryWithChildren) {
|
||||||
|
Trace.beginSection("ExpNotRow#onNotifUpdated (summary)");
|
||||||
|
} else {
|
||||||
|
Trace.beginSection("ExpNotRow#onNotifUpdated (leaf)");
|
||||||
|
}
|
||||||
for (NotificationContentView l : mLayouts) {
|
for (NotificationContentView l : mLayouts) {
|
||||||
l.onNotificationUpdated(mEntry);
|
l.onNotificationUpdated(mEntry);
|
||||||
}
|
}
|
||||||
@@ -591,6 +596,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
mUpdateSelfBackgroundOnUpdate = false;
|
mUpdateSelfBackgroundOnUpdate = false;
|
||||||
updateBackgroundColorsOfSelf();
|
updateBackgroundColorsOfSelf();
|
||||||
}
|
}
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBackgroundColorsOfSelf() {
|
private void updateBackgroundColorsOfSelf() {
|
||||||
@@ -2588,6 +2594,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
mIsSummaryWithChildren = mChildrenContainer != null
|
mIsSummaryWithChildren = mChildrenContainer != null
|
||||||
&& mChildrenContainer.getNotificationChildCount() > 0;
|
&& mChildrenContainer.getNotificationChildCount() > 0;
|
||||||
if (mIsSummaryWithChildren) {
|
if (mIsSummaryWithChildren) {
|
||||||
|
Trace.beginSection("ExpNotRow#onChildCountChanged (summary)");
|
||||||
NotificationViewWrapper wrapper = mChildrenContainer.getNotificationViewWrapper();
|
NotificationViewWrapper wrapper = mChildrenContainer.getNotificationViewWrapper();
|
||||||
if (wrapper == null || wrapper.getNotificationHeader() == null) {
|
if (wrapper == null || wrapper.getNotificationHeader() == null) {
|
||||||
mChildrenContainer.recreateNotificationHeader(mExpandClickListener,
|
mChildrenContainer.recreateNotificationHeader(mExpandClickListener,
|
||||||
@@ -2599,6 +2606,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
|||||||
updateChildrenAppearance();
|
updateChildrenAppearance();
|
||||||
updateChildrenVisibility();
|
updateChildrenVisibility();
|
||||||
applyChildrenRoundness();
|
applyChildrenRoundness();
|
||||||
|
if (mIsSummaryWithChildren) {
|
||||||
|
Trace.endSection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void expandNotification() {
|
protected void expandNotification() {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.annotation.Nullable;
|
|||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.os.Trace;
|
||||||
import android.service.notification.StatusBarNotification;
|
import android.service.notification.StatusBarNotification;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
@@ -57,6 +58,7 @@ public class HybridGroupManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private HybridNotificationView inflateHybridView(View contentView, ViewGroup parent) {
|
private HybridNotificationView inflateHybridView(View contentView, ViewGroup parent) {
|
||||||
|
Trace.beginSection("HybridGroupManager#inflateHybridView");
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
LayoutInflater inflater = LayoutInflater.from(mContext);
|
||||||
int layout = contentView instanceof ConversationLayout
|
int layout = contentView instanceof ConversationLayout
|
||||||
? R.layout.hybrid_conversation_notification
|
? R.layout.hybrid_conversation_notification
|
||||||
@@ -64,6 +66,7 @@ public class HybridGroupManager {
|
|||||||
HybridNotificationView hybrid = (HybridNotificationView)
|
HybridNotificationView hybrid = (HybridNotificationView)
|
||||||
inflater.inflate(layout, parent, false);
|
inflater.inflate(layout, parent, false);
|
||||||
parent.addView(hybrid);
|
parent.addView(hybrid);
|
||||||
|
Trace.endSection();
|
||||||
return hybrid;
|
return hybrid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,12 +93,18 @@ public class HybridGroupManager {
|
|||||||
public HybridNotificationView bindFromNotification(HybridNotificationView reusableView,
|
public HybridNotificationView bindFromNotification(HybridNotificationView reusableView,
|
||||||
View contentView, StatusBarNotification notification,
|
View contentView, StatusBarNotification notification,
|
||||||
ViewGroup parent) {
|
ViewGroup parent) {
|
||||||
|
boolean isNewView = false;
|
||||||
if (reusableView == null) {
|
if (reusableView == null) {
|
||||||
|
Trace.beginSection("HybridGroupManager#bindFromNotification");
|
||||||
reusableView = inflateHybridView(contentView, parent);
|
reusableView = inflateHybridView(contentView, parent);
|
||||||
|
isNewView = true;
|
||||||
}
|
}
|
||||||
CharSequence titleText = resolveTitle(notification.getNotification());
|
CharSequence titleText = resolveTitle(notification.getNotification());
|
||||||
CharSequence contentText = resolveText(notification.getNotification());
|
CharSequence contentText = resolveText(notification.getNotification());
|
||||||
reusableView.bind(titleText, contentText, contentView);
|
reusableView.bind(titleText, contentText, contentView);
|
||||||
|
if (isNewView) {
|
||||||
|
Trace.endSection();
|
||||||
|
}
|
||||||
return reusableView;
|
return reusableView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import android.graphics.Rect;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.os.Trace;
|
||||||
import android.service.notification.StatusBarNotification;
|
import android.service.notification.StatusBarNotification;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -1193,6 +1194,7 @@ public class NotificationContentView extends FrameLayout implements Notification
|
|||||||
|
|
||||||
private void updateSingleLineView() {
|
private void updateSingleLineView() {
|
||||||
if (mIsChildInGroup) {
|
if (mIsChildInGroup) {
|
||||||
|
Trace.beginSection("NotifContentView#updateSingleLineView");
|
||||||
boolean isNewView = mSingleLineView == null;
|
boolean isNewView = mSingleLineView == null;
|
||||||
mSingleLineView = mHybridGroupManager.bindFromNotification(
|
mSingleLineView = mHybridGroupManager.bindFromNotification(
|
||||||
mSingleLineView, mContractedChild, mNotificationEntry.getSbn(), this);
|
mSingleLineView, mContractedChild, mNotificationEntry.getSbn(), this);
|
||||||
@@ -1200,6 +1202,7 @@ public class NotificationContentView extends FrameLayout implements Notification
|
|||||||
updateViewVisibility(mVisibleType, VISIBLE_TYPE_SINGLELINE,
|
updateViewVisibility(mVisibleType, VISIBLE_TYPE_SINGLELINE,
|
||||||
mSingleLineView, mSingleLineView);
|
mSingleLineView, mSingleLineView);
|
||||||
}
|
}
|
||||||
|
Trace.endSection();
|
||||||
} else if (mSingleLineView != null) {
|
} else if (mSingleLineView != null) {
|
||||||
removeView(mSingleLineView);
|
removeView(mSingleLineView);
|
||||||
mSingleLineView = null;
|
mSingleLineView = null;
|
||||||
|
|||||||
@@ -379,6 +379,7 @@ public class NotificationChildrenContainer extends ViewGroup
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void recreateNotificationHeader(OnClickListener listener, boolean isConversation) {
|
public void recreateNotificationHeader(OnClickListener listener, boolean isConversation) {
|
||||||
|
Trace.beginSection("NotifChildCont#recreateHeader");
|
||||||
mHeaderClickListener = listener;
|
mHeaderClickListener = listener;
|
||||||
mIsConversation = isConversation;
|
mIsConversation = isConversation;
|
||||||
StatusBarNotification notification = mContainingNotification.getEntry().getSbn();
|
StatusBarNotification notification = mContainingNotification.getEntry().getSbn();
|
||||||
@@ -406,6 +407,7 @@ public class NotificationChildrenContainer extends ViewGroup
|
|||||||
recreateLowPriorityHeader(builder, isConversation);
|
recreateLowPriorityHeader(builder, isConversation);
|
||||||
updateHeaderVisibility(false /* animate */);
|
updateHeaderVisibility(false /* animate */);
|
||||||
updateChildrenAppearance();
|
updateChildrenAppearance();
|
||||||
|
Trace.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user