Skip to content
Snippets Groups Projects
Commit 488bba98 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz Committed by Android (Google) Code Review
Browse files

Merge "Apply Graph Optimizer to QS Container" into main

parents ef5e3b1a 13fa43b0
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,9 @@ class NotificationsQSContainerController @Inject constructor(
mView.setStackScroller(notificationStackScrollLayoutController.getView())
mView.setMigratingNSSL(featureFlags.isEnabled(Flags.MIGRATE_NSSL))
if (featureFlags.isEnabled(Flags.QS_CONTAINER_GRAPH_OPTIMIZER)){
mView.enableGraphOptimization()
}
}
public override fun onViewAttached() {
......
......@@ -16,6 +16,8 @@
package com.android.systemui.shade;
import static androidx.constraintlayout.core.widgets.Optimizer.OPTIMIZATION_GRAPH;
import android.app.Fragment;
import android.content.Context;
import android.content.res.Configuration;
......@@ -24,7 +26,6 @@ import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup.MarginLayoutParams;
import android.view.WindowInsets;
import androidx.annotation.Nullable;
......@@ -183,6 +184,10 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout
mIsMigratingNSSL = isMigrating;
}
void enableGraphOptimization() {
setOptimizationLevel(getOptimizationLevel() | OPTIMIZATION_GRAPH);
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return TouchLogger.logDispatchTouch("NotificationsQuickSettingsContainer", ev,
......
......@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.notification.stack.ui.view
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.constraintlayout.core.widgets.Optimizer
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.constraintlayout.widget.ConstraintSet
import androidx.constraintlayout.widget.ConstraintSet.BOTTOM
......@@ -45,6 +46,7 @@ class SharedNotificationContainer(
private val baseConstraintSet = ConstraintSet()
init {
optimizationLevel = optimizationLevel or Optimizer.OPTIMIZATION_GRAPH
baseConstraintSet.apply {
create(R.id.nssl_guideline, VERTICAL)
setGuidelinePercent(R.id.nssl_guideline, 0.5f)
......
......@@ -101,7 +101,11 @@ class NotificationsQSContainerControllerLegacyTest : SysuiTestCase() {
MockitoAnnotations.initMocks(this)
fakeSystemClock = FakeSystemClock()
delayableExecutor = FakeExecutor(fakeSystemClock)
featureFlags = FakeFeatureFlags().apply { set(Flags.MIGRATE_NSSL, false) }
featureFlags =
FakeFeatureFlags().apply {
set(Flags.MIGRATE_NSSL, false)
set(Flags.QS_CONTAINER_GRAPH_OPTIMIZER, false)
}
mContext.ensureTestableResources()
whenever(view.context).thenReturn(mContext)
whenever(view.resources).thenReturn(mContext.resources)
......
......@@ -100,7 +100,11 @@ class NotificationsQSContainerControllerTest : SysuiTestCase() {
MockitoAnnotations.initMocks(this)
fakeSystemClock = FakeSystemClock()
delayableExecutor = FakeExecutor(fakeSystemClock)
featureFlags = FakeFeatureFlags().apply { set(Flags.MIGRATE_NSSL, true) }
featureFlags =
FakeFeatureFlags().apply {
set(Flags.MIGRATE_NSSL, true)
set(Flags.QS_CONTAINER_GRAPH_OPTIMIZER, true)
}
mContext.ensureTestableResources()
whenever(view.context).thenReturn(mContext)
whenever(view.resources).thenReturn(mContext.resources)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment