Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -230,7 +230,13 @@ public class ShadeListBuilder implements Dumpable { mPipelineState.requireState(STATE_IDLE); mPipelineState.requireState(STATE_IDLE); mNotifSections.clear(); mNotifSections.clear(); NotifSectioner lastSection = null; for (NotifSectioner sectioner : sectioners) { for (NotifSectioner sectioner : sectioners) { if (lastSection != null && lastSection.getBucket() > sectioner.getBucket()) { throw new IllegalArgumentException("setSectioners with non contiguous sections " + lastSection.getName() + " - " + lastSection.getBucket() + " & " + sectioner.getName() + " - " + sectioner.getBucket()); } final NotifSection section = new NotifSection(sectioner, mNotifSections.size()); final NotifSection section = new NotifSection(sectioner, mNotifSections.size()); final NotifComparator sectionComparator = section.getComparator(); final NotifComparator sectionComparator = section.getComparator(); mNotifSections.add(section); mNotifSections.add(section); Loading @@ -238,6 +244,7 @@ public class ShadeListBuilder implements Dumpable { if (sectionComparator != null) { if (sectionComparator != null) { sectionComparator.setInvalidationListener(this::onNotifComparatorInvalidated); sectionComparator.setInvalidationListener(this::onNotifComparatorInvalidated); } } lastSection = sectioner; } } mNotifSections.add(new NotifSection(DEFAULT_SECTIONER, mNotifSections.size())); mNotifSections.add(new NotifSection(DEFAULT_SECTIONER, mNotifSections.size())); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeSpecBuilder.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ class NodeSpecBuilder( var currentSection: NotifSection? = null var currentSection: NotifSection? = null val prevSections = mutableSetOf<NotifSection?>() val prevSections = mutableSetOf<NotifSection?>() var lastSection: NotifSection? = null val showHeaders = sectionHeaderVisibilityProvider.sectionHeadersVisible val showHeaders = sectionHeaderVisibilityProvider.sectionHeadersVisible val sectionOrder = mutableListOf<NotifSection?>() val sectionOrder = mutableListOf<NotifSection?>() val sectionHeaders = mutableMapOf<NotifSection?, NodeController?>() val sectionHeaders = mutableMapOf<NotifSection?, NodeController?>() Loading @@ -65,6 +66,14 @@ class NodeSpecBuilder( for (entry in notifList) { for (entry in notifList) { val section = entry.section!! val section = entry.section!! lastSection?.let { if (it.bucket > section.bucket) { throw IllegalStateException("buildNodeSpec with non contiguous section " + "buckets ${it.sectioner.name} - ${it.bucket} & " + "${it.sectioner.name} - ${it.bucket}") } } lastSection = section if (prevSections.contains(section)) { if (prevSections.contains(section)) { throw java.lang.RuntimeException("Section ${section.label} has been duplicated") throw java.lang.RuntimeException("Section ${section.label} has been duplicated") } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -230,7 +230,13 @@ public class ShadeListBuilder implements Dumpable { mPipelineState.requireState(STATE_IDLE); mPipelineState.requireState(STATE_IDLE); mNotifSections.clear(); mNotifSections.clear(); NotifSectioner lastSection = null; for (NotifSectioner sectioner : sectioners) { for (NotifSectioner sectioner : sectioners) { if (lastSection != null && lastSection.getBucket() > sectioner.getBucket()) { throw new IllegalArgumentException("setSectioners with non contiguous sections " + lastSection.getName() + " - " + lastSection.getBucket() + " & " + sectioner.getName() + " - " + sectioner.getBucket()); } final NotifSection section = new NotifSection(sectioner, mNotifSections.size()); final NotifSection section = new NotifSection(sectioner, mNotifSections.size()); final NotifComparator sectionComparator = section.getComparator(); final NotifComparator sectionComparator = section.getComparator(); mNotifSections.add(section); mNotifSections.add(section); Loading @@ -238,6 +244,7 @@ public class ShadeListBuilder implements Dumpable { if (sectionComparator != null) { if (sectionComparator != null) { sectionComparator.setInvalidationListener(this::onNotifComparatorInvalidated); sectionComparator.setInvalidationListener(this::onNotifComparatorInvalidated); } } lastSection = sectioner; } } mNotifSections.add(new NotifSection(DEFAULT_SECTIONER, mNotifSections.size())); mNotifSections.add(new NotifSection(DEFAULT_SECTIONER, mNotifSections.size())); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/render/NodeSpecBuilder.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ class NodeSpecBuilder( var currentSection: NotifSection? = null var currentSection: NotifSection? = null val prevSections = mutableSetOf<NotifSection?>() val prevSections = mutableSetOf<NotifSection?>() var lastSection: NotifSection? = null val showHeaders = sectionHeaderVisibilityProvider.sectionHeadersVisible val showHeaders = sectionHeaderVisibilityProvider.sectionHeadersVisible val sectionOrder = mutableListOf<NotifSection?>() val sectionOrder = mutableListOf<NotifSection?>() val sectionHeaders = mutableMapOf<NotifSection?, NodeController?>() val sectionHeaders = mutableMapOf<NotifSection?, NodeController?>() Loading @@ -65,6 +66,14 @@ class NodeSpecBuilder( for (entry in notifList) { for (entry in notifList) { val section = entry.section!! val section = entry.section!! lastSection?.let { if (it.bucket > section.bucket) { throw IllegalStateException("buildNodeSpec with non contiguous section " + "buckets ${it.sectioner.name} - ${it.bucket} & " + "${it.sectioner.name} - ${it.bucket}") } } lastSection = section if (prevSections.contains(section)) { if (prevSections.contains(section)) { throw java.lang.RuntimeException("Section ${section.label} has been duplicated") throw java.lang.RuntimeException("Section ${section.label} has been duplicated") } } Loading