Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } //TODO: Replace this API with RowContentBindParams directly row.setNeedsRedaction(mNotificationLockscreenUserManager.needsRedaction(entry)); params.rebindAllContentViews(); mRowContentBindStage.requestRebind(entry, en -> { row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight); row.setUsesIncreasedHeadsUpHeight(useIncreasedHeadsUp); Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java +8 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,14 @@ public final class RowContentBindParams { return mContentViews; } /** * Request that all content views be rebound. This may happen if, for example, the underlying * layout has changed. */ public void rebindAllContentViews() { mDirtyContentViews = mContentViews; } /** * Clears all dirty content views so that they no longer need to be rebound. */ Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java +24 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ public class RowContentBindStageTest extends SysuiTestCase { } @Test public void testSetShouldContentViewsBeBound_bindsContent() { public void testRequireContentViews() { // WHEN inflation flags are set and pipeline is invalidated. final int flags = FLAG_CONTENT_VIEW_CONTRACTED | FLAG_CONTENT_VIEW_EXPANDED; RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); Loading @@ -85,7 +85,7 @@ public class RowContentBindStageTest extends SysuiTestCase { } @Test public void testSetShouldContentViewsBeBound_unbindsContent() { public void testFreeContentViews() { // GIVEN a view with all content bound. RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); params.requireContentViews(FLAG_CONTENT_VIEW_ALL); Loading @@ -99,6 +99,28 @@ public class RowContentBindStageTest extends SysuiTestCase { verify(mBinder).unbindContent(eq(mEntry), any(), eq(flags)); } @Test public void testRebindAllContentViews() { // GIVEN a view with content bound. RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); final int flags = FLAG_CONTENT_VIEW_CONTRACTED | FLAG_CONTENT_VIEW_EXPANDED; params.requireContentViews(flags); params.clearDirtyContentViews(); // WHEN we request rebind and stage executed. params.rebindAllContentViews(); mRowContentBindStage.executeStage(mEntry, mRow, (en) -> { }); // THEN binder binds inflation flags. verify(mBinder).bindContent( eq(mEntry), any(), eq(flags), any(), anyBoolean(), any()); } @Test public void testSetUseLowPriority() { // GIVEN a view with all content bound. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/inflation/NotificationRowBinderImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,7 @@ public class NotificationRowBinderImpl implements NotificationRowBinder { } //TODO: Replace this API with RowContentBindParams directly row.setNeedsRedaction(mNotificationLockscreenUserManager.needsRedaction(entry)); params.rebindAllContentViews(); mRowContentBindStage.requestRebind(entry, en -> { row.setUsesIncreasedCollapsedHeight(useIncreasedCollapsedHeight); row.setUsesIncreasedHeadsUpHeight(useIncreasedHeadsUp); Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowContentBindParams.java +8 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,14 @@ public final class RowContentBindParams { return mContentViews; } /** * Request that all content views be rebound. This may happen if, for example, the underlying * layout has changed. */ public void rebindAllContentViews() { mDirtyContentViews = mContentViews; } /** * Clears all dirty content views so that they no longer need to be rebound. */ Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java +24 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ public class RowContentBindStageTest extends SysuiTestCase { } @Test public void testSetShouldContentViewsBeBound_bindsContent() { public void testRequireContentViews() { // WHEN inflation flags are set and pipeline is invalidated. final int flags = FLAG_CONTENT_VIEW_CONTRACTED | FLAG_CONTENT_VIEW_EXPANDED; RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); Loading @@ -85,7 +85,7 @@ public class RowContentBindStageTest extends SysuiTestCase { } @Test public void testSetShouldContentViewsBeBound_unbindsContent() { public void testFreeContentViews() { // GIVEN a view with all content bound. RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); params.requireContentViews(FLAG_CONTENT_VIEW_ALL); Loading @@ -99,6 +99,28 @@ public class RowContentBindStageTest extends SysuiTestCase { verify(mBinder).unbindContent(eq(mEntry), any(), eq(flags)); } @Test public void testRebindAllContentViews() { // GIVEN a view with content bound. RowContentBindParams params = mRowContentBindStage.getStageParams(mEntry); final int flags = FLAG_CONTENT_VIEW_CONTRACTED | FLAG_CONTENT_VIEW_EXPANDED; params.requireContentViews(flags); params.clearDirtyContentViews(); // WHEN we request rebind and stage executed. params.rebindAllContentViews(); mRowContentBindStage.executeStage(mEntry, mRow, (en) -> { }); // THEN binder binds inflation flags. verify(mBinder).bindContent( eq(mEntry), any(), eq(flags), any(), anyBoolean(), any()); } @Test public void testSetUseLowPriority() { // GIVEN a view with all content bound. Loading