Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.Ranking; Loading Loading @@ -512,6 +513,7 @@ public class NotifCollection implements Dumpable { } private void dispatchEventsAndRebuildList() { Trace.beginSection("NotifCollection.dispatchEventsAndRebuildList"); mAmDispatchingToOtherCode = true; while (!mEventQueue.isEmpty()) { mEventQueue.remove().dispatchTo(mNotifCollectionListeners); Loading @@ -521,6 +523,7 @@ public class NotifCollection implements Dumpable { if (mBuildListener != null) { mBuildListener.onBuildList(mReadOnlyNotificationSet); } Trace.endSection(); } private void onEndLifetimeExtension( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +27 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.systemui.statusbar.notification.collection.listbuilder import android.annotation.MainThread; import android.annotation.Nullable; import android.os.Trace; import android.util.ArrayMap; import androidx.annotation.NonNull; Loading Loading @@ -332,6 +333,7 @@ public class ShadeListBuilder implements Dumpable { * if we detect that behavior, we should crash instantly. */ private void buildList() { Trace.beginSection("ShadeListBuilder.buildList"); mPipelineState.requireIsBefore(STATE_BUILD_STARTED); mPipelineState.setState(STATE_BUILD_STARTED); Loading Loading @@ -385,9 +387,11 @@ public class ShadeListBuilder implements Dumpable { // Step 8: Dispatch the new list, first to any listeners and then to the view layer dispatchOnBeforeRenderList(mReadOnlyNotifList); Trace.beginSection("ShadeListBuilder.onRenderList"); if (mOnRenderListListener != null) { mOnRenderListListener.onRenderList(mReadOnlyNotifList); } Trace.endSection(); // Step 9: We're done! mLogger.logEndBuildList( Loading @@ -399,9 +403,11 @@ public class ShadeListBuilder implements Dumpable { } mPipelineState.setState(STATE_IDLE); mIterationCount++; Trace.endSection(); } private void notifySectionEntriesUpdated() { Trace.beginSection("ShadeListBuilder.notifySectionEntriesUpdated"); NotifSection currentSection = null; mTempSectionMembers.clear(); for (int i = 0; i < mNotifList.size(); i++) { Loading @@ -415,6 +421,7 @@ public class ShadeListBuilder implements Dumpable { } mTempSectionMembers.add(currentEntry); } Trace.endSection(); } /** Loading Loading @@ -456,6 +463,7 @@ public class ShadeListBuilder implements Dumpable { Collection<? extends ListEntry> entries, List<ListEntry> out, List<NotifFilter> filters) { Trace.beginSection("ShadeListBuilder.filterNotifs"); final long now = mSystemClock.uptimeMillis(); for (ListEntry entry : entries) { if (entry instanceof GroupEntry) { Loading Loading @@ -487,9 +495,11 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } private void groupNotifs(List<ListEntry> entries, List<ListEntry> out) { Trace.beginSection("ShadeListBuilder.groupNotifs"); for (ListEntry listEntry : entries) { // since grouping hasn't happened yet, all notifs are NotificationEntries NotificationEntry entry = (NotificationEntry) listEntry; Loading Loading @@ -545,12 +555,14 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } private void stabilizeGroupingNotifs(List<ListEntry> topLevelList) { if (mNotifStabilityManager == null) { return; } Trace.beginSection("ShadeListBuilder.stabilizeGroupingNotifs"); for (int i = 0; i < topLevelList.size(); i++) { final ListEntry tle = topLevelList.get(i); Loading @@ -576,6 +588,7 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } /** Loading Loading @@ -608,6 +621,7 @@ public class ShadeListBuilder implements Dumpable { } private void promoteNotifs(List<ListEntry> list) { Trace.beginSection("ShadeListBuilder.promoteNotifs"); for (int i = 0; i < list.size(); i++) { final ListEntry tle = list.get(i); Loading @@ -626,9 +640,11 @@ public class ShadeListBuilder implements Dumpable { }); } } Trace.endSection(); } private void pruneIncompleteGroups(List<ListEntry> shadeList) { Trace.beginSection("ShadeListBuilder.pruneIncompleteGroups"); for (int i = 0; i < shadeList.size(); i++) { final ListEntry tle = shadeList.get(i); Loading Loading @@ -683,6 +699,7 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } /** Loading Loading @@ -749,6 +766,7 @@ public class ShadeListBuilder implements Dumpable { } private void sortListAndNotifySections() { Trace.beginSection("ShadeListBuilder.sortListAndNotifySections"); // Assign sections to top-level elements and sort their children for (ListEntry entry : mNotifList) { NotifSection section = applySections(entry); Loading @@ -766,6 +784,7 @@ public class ShadeListBuilder implements Dumpable { // notify sections since the list is sorted now notifySectionEntriesUpdated(); Trace.endSection(); } private void freeEmptyGroups() { Loading Loading @@ -1016,27 +1035,35 @@ public class ShadeListBuilder implements Dumpable { } private void dispatchOnBeforeTransformGroups(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeTransformGroups"); for (int i = 0; i < mOnBeforeTransformGroupsListeners.size(); i++) { mOnBeforeTransformGroupsListeners.get(i).onBeforeTransformGroups(entries); } Trace.endSection(); } private void dispatchOnBeforeSort(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeSort"); for (int i = 0; i < mOnBeforeSortListeners.size(); i++) { mOnBeforeSortListeners.get(i).onBeforeSort(entries); } Trace.endSection(); } private void dispatchOnBeforeFinalizeFilter(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeFinalizeFilter"); for (int i = 0; i < mOnBeforeFinalizeFilterListeners.size(); i++) { mOnBeforeFinalizeFilterListeners.get(i).onBeforeFinalizeFilter(entries); } Trace.endSection(); } private void dispatchOnBeforeRenderList(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeRenderList"); for (int i = 0; i < mOnBeforeRenderListListeners.size(); i++) { mOnBeforeRenderListListeners.get(i).onBeforeRenderList(entries); } Trace.endSection(); } @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/listbuilder/pluggable/Pluggable.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.collection.listbuilder.pluggable; import android.annotation.Nullable; import android.os.Trace; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -50,7 +51,9 @@ public abstract class Pluggable<This> { */ public final void invalidateList() { if (mListener != null) { Trace.beginSection("Pluggable<" + mName + ">.invalidateList"); mListener.onPluggableInvalidated((This) this); Trace.endSection(); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeSpecBuilder.kt +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.statusbar.notification.collection.GroupEntry import com.android.systemui.statusbar.notification.collection.ListEntry import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.listbuilder.NotifSection import com.android.systemui.util.traceSection /** * Converts a notif list (the output of the ShadeListBuilder) into a NodeSpec, an abstract Loading @@ -36,7 +37,7 @@ class NodeSpecBuilder( fun buildNodeSpec( rootController: NodeController, notifList: List<ListEntry> ): NodeSpec { ): NodeSpec = traceSection("NodeSpecBuilder.buildNodeSpec") { val root = NodeSpecImpl(null, rootController) var currentSection: NotifSection? = null val prevSections = mutableSetOf<NotifSection?>() Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.collection.render import android.annotation.MainThread import android.view.View import com.android.systemui.util.kotlin.transform import com.android.systemui.util.traceSection /** * Given a "spec" that describes a "tree" of views, adds and removes views from the Loading Loading @@ -47,7 +48,7 @@ class ShadeViewDiffer( * provided [spec]. The root node of the spec must match the root controller passed to the * differ's constructor. */ fun applySpec(spec: NodeSpec) { fun applySpec(spec: NodeSpec) = traceSection("ShadeViewDiffer.applySpec") { val specMap = treeToMap(spec) if (spec.controller != rootNode.controller) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotifCollection.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.Notification; import android.os.RemoteException; import android.os.Trace; import android.os.UserHandle; import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.Ranking; Loading Loading @@ -512,6 +513,7 @@ public class NotifCollection implements Dumpable { } private void dispatchEventsAndRebuildList() { Trace.beginSection("NotifCollection.dispatchEventsAndRebuildList"); mAmDispatchingToOtherCode = true; while (!mEventQueue.isEmpty()) { mEventQueue.remove().dispatchTo(mNotifCollectionListeners); Loading @@ -521,6 +523,7 @@ public class NotifCollection implements Dumpable { if (mBuildListener != null) { mBuildListener.onBuildList(mReadOnlyNotificationSet); } Trace.endSection(); } private void onEndLifetimeExtension( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +27 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import static com.android.systemui.statusbar.notification.collection.listbuilder import android.annotation.MainThread; import android.annotation.Nullable; import android.os.Trace; import android.util.ArrayMap; import androidx.annotation.NonNull; Loading Loading @@ -332,6 +333,7 @@ public class ShadeListBuilder implements Dumpable { * if we detect that behavior, we should crash instantly. */ private void buildList() { Trace.beginSection("ShadeListBuilder.buildList"); mPipelineState.requireIsBefore(STATE_BUILD_STARTED); mPipelineState.setState(STATE_BUILD_STARTED); Loading Loading @@ -385,9 +387,11 @@ public class ShadeListBuilder implements Dumpable { // Step 8: Dispatch the new list, first to any listeners and then to the view layer dispatchOnBeforeRenderList(mReadOnlyNotifList); Trace.beginSection("ShadeListBuilder.onRenderList"); if (mOnRenderListListener != null) { mOnRenderListListener.onRenderList(mReadOnlyNotifList); } Trace.endSection(); // Step 9: We're done! mLogger.logEndBuildList( Loading @@ -399,9 +403,11 @@ public class ShadeListBuilder implements Dumpable { } mPipelineState.setState(STATE_IDLE); mIterationCount++; Trace.endSection(); } private void notifySectionEntriesUpdated() { Trace.beginSection("ShadeListBuilder.notifySectionEntriesUpdated"); NotifSection currentSection = null; mTempSectionMembers.clear(); for (int i = 0; i < mNotifList.size(); i++) { Loading @@ -415,6 +421,7 @@ public class ShadeListBuilder implements Dumpable { } mTempSectionMembers.add(currentEntry); } Trace.endSection(); } /** Loading Loading @@ -456,6 +463,7 @@ public class ShadeListBuilder implements Dumpable { Collection<? extends ListEntry> entries, List<ListEntry> out, List<NotifFilter> filters) { Trace.beginSection("ShadeListBuilder.filterNotifs"); final long now = mSystemClock.uptimeMillis(); for (ListEntry entry : entries) { if (entry instanceof GroupEntry) { Loading Loading @@ -487,9 +495,11 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } private void groupNotifs(List<ListEntry> entries, List<ListEntry> out) { Trace.beginSection("ShadeListBuilder.groupNotifs"); for (ListEntry listEntry : entries) { // since grouping hasn't happened yet, all notifs are NotificationEntries NotificationEntry entry = (NotificationEntry) listEntry; Loading Loading @@ -545,12 +555,14 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } private void stabilizeGroupingNotifs(List<ListEntry> topLevelList) { if (mNotifStabilityManager == null) { return; } Trace.beginSection("ShadeListBuilder.stabilizeGroupingNotifs"); for (int i = 0; i < topLevelList.size(); i++) { final ListEntry tle = topLevelList.get(i); Loading @@ -576,6 +588,7 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } /** Loading Loading @@ -608,6 +621,7 @@ public class ShadeListBuilder implements Dumpable { } private void promoteNotifs(List<ListEntry> list) { Trace.beginSection("ShadeListBuilder.promoteNotifs"); for (int i = 0; i < list.size(); i++) { final ListEntry tle = list.get(i); Loading @@ -626,9 +640,11 @@ public class ShadeListBuilder implements Dumpable { }); } } Trace.endSection(); } private void pruneIncompleteGroups(List<ListEntry> shadeList) { Trace.beginSection("ShadeListBuilder.pruneIncompleteGroups"); for (int i = 0; i < shadeList.size(); i++) { final ListEntry tle = shadeList.get(i); Loading Loading @@ -683,6 +699,7 @@ public class ShadeListBuilder implements Dumpable { } } } Trace.endSection(); } /** Loading Loading @@ -749,6 +766,7 @@ public class ShadeListBuilder implements Dumpable { } private void sortListAndNotifySections() { Trace.beginSection("ShadeListBuilder.sortListAndNotifySections"); // Assign sections to top-level elements and sort their children for (ListEntry entry : mNotifList) { NotifSection section = applySections(entry); Loading @@ -766,6 +784,7 @@ public class ShadeListBuilder implements Dumpable { // notify sections since the list is sorted now notifySectionEntriesUpdated(); Trace.endSection(); } private void freeEmptyGroups() { Loading Loading @@ -1016,27 +1035,35 @@ public class ShadeListBuilder implements Dumpable { } private void dispatchOnBeforeTransformGroups(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeTransformGroups"); for (int i = 0; i < mOnBeforeTransformGroupsListeners.size(); i++) { mOnBeforeTransformGroupsListeners.get(i).onBeforeTransformGroups(entries); } Trace.endSection(); } private void dispatchOnBeforeSort(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeSort"); for (int i = 0; i < mOnBeforeSortListeners.size(); i++) { mOnBeforeSortListeners.get(i).onBeforeSort(entries); } Trace.endSection(); } private void dispatchOnBeforeFinalizeFilter(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeFinalizeFilter"); for (int i = 0; i < mOnBeforeFinalizeFilterListeners.size(); i++) { mOnBeforeFinalizeFilterListeners.get(i).onBeforeFinalizeFilter(entries); } Trace.endSection(); } private void dispatchOnBeforeRenderList(List<ListEntry> entries) { Trace.beginSection("ShadeListBuilder.dispatchOnBeforeRenderList"); for (int i = 0; i < mOnBeforeRenderListListeners.size(); i++) { mOnBeforeRenderListListeners.get(i).onBeforeRenderList(entries); } Trace.endSection(); } @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/listbuilder/pluggable/Pluggable.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.statusbar.notification.collection.listbuilder.pluggable; import android.annotation.Nullable; import android.os.Trace; import com.android.systemui.statusbar.notification.collection.NotifPipeline; Loading Loading @@ -50,7 +51,9 @@ public abstract class Pluggable<This> { */ public final void invalidateList() { if (mListener != null) { Trace.beginSection("Pluggable<" + mName + ">.invalidateList"); mListener.onPluggableInvalidated((This) this); Trace.endSection(); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeSpecBuilder.kt +2 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import com.android.systemui.statusbar.notification.collection.GroupEntry import com.android.systemui.statusbar.notification.collection.ListEntry import com.android.systemui.statusbar.notification.collection.NotificationEntry import com.android.systemui.statusbar.notification.collection.listbuilder.NotifSection import com.android.systemui.util.traceSection /** * Converts a notif list (the output of the ShadeListBuilder) into a NodeSpec, an abstract Loading @@ -36,7 +37,7 @@ class NodeSpecBuilder( fun buildNodeSpec( rootController: NodeController, notifList: List<ListEntry> ): NodeSpec { ): NodeSpec = traceSection("NodeSpecBuilder.buildNodeSpec") { val root = NodeSpecImpl(null, rootController) var currentSection: NotifSection? = null val prevSections = mutableSetOf<NotifSection?>() Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDiffer.kt +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.collection.render import android.annotation.MainThread import android.view.View import com.android.systemui.util.kotlin.transform import com.android.systemui.util.traceSection /** * Given a "spec" that describes a "tree" of views, adds and removes views from the Loading Loading @@ -47,7 +48,7 @@ class ShadeViewDiffer( * provided [spec]. The root node of the spec must match the root controller passed to the * differ's constructor. */ fun applySpec(spec: NodeSpec) { fun applySpec(spec: NodeSpec) = traceSection("ShadeViewDiffer.applySpec") { val specMap = treeToMap(spec) if (spec.controller != rootNode.controller) { Loading