Loading packages/SystemUI/aconfig/systemui.aconfig +0 −20 Original line number Diff line number Diff line Loading @@ -897,26 +897,6 @@ flag { } } flag { name: "use_notif_inflation_thread_for_footer" namespace: "systemui" description: "use the @NotifInflation thread for FooterView and EmptyShadeView inflation" bug: "375320642" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "use_notif_inflation_thread_for_row" namespace: "systemui" description: "use the @NotifInflation thread for ExpandableNotificationRow inflation" bug: "375320642" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "notify_power_manager_user_activity_background" namespace: "systemui" Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class DynamicChildBindControllerTest extends SysuiTestCase { private ExpandableNotificationRow createRow(NotificationEntry entry) { LayoutInflater inflater = LayoutInflater.from(mContext); inflater.setFactory2( new RowInflaterTask.RowAsyncLayoutInflater(entry, new FakeSystemClock(), mock( new RowInflaterTask.RowAsyncLayoutFactory(entry, new FakeSystemClock(), mock( RowInflaterTaskLogger.class), mContext.getUser())); ExpandableNotificationRow row = (ExpandableNotificationRow) Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowInflaterTask.java +14 −27 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.asynclayoutinflater.view.AsyncLayoutFactory; import androidx.asynclayoutinflater.view.AsyncLayoutInflater; import com.android.systemui.Flags; import com.android.systemui.res.R; Loading @@ -49,8 +48,7 @@ import javax.inject.Inject; /** * An inflater task that asynchronously inflates a ExpandableNotificationRow */ public class RowInflaterTask implements InflationTask, AsyncLayoutInflater.OnInflateFinishedListener, AsyncRowInflater.OnInflateFinishedListener { public class RowInflaterTask implements InflationTask, AsyncRowInflater.OnInflateFinishedListener { private static final String TAG = "RowInflaterTask"; private static final boolean TRACE_ORIGIN = true; Loading Loading @@ -95,17 +93,11 @@ public class RowInflaterTask implements InflationTask, } mBundleEntry = entry; mListener = listener; RowAsyncLayoutInflater asyncLayoutFactory = new RowAsyncLayoutInflater( RowAsyncLayoutFactory asyncLayoutFactory = new RowAsyncLayoutFactory( entry, mSystemClock, mLogger, mUserTracker.getUserHandle()); if (Flags.useNotifInflationThreadForRow()) { debugBundleLog(TAG, () -> "mAsyncRowInflater.inflate bundle: " + entry.getKey()); mAsyncRowInflater.inflate(context, asyncLayoutFactory, R.layout.status_bar_notification_row, parent, this); } else { debugBundleLog(TAG, () -> "AsyncLayoutInflater.inflate bundle: " + entry.getKey()); AsyncLayoutInflater inflater = new AsyncLayoutInflater(context, asyncLayoutFactory); inflater.inflate(R.layout.status_bar_notification_row, parent, listenerExecutor, this); } } /** Loading @@ -120,19 +112,14 @@ public class RowInflaterTask implements InflationTask, mInflateOrigin = new Throwable("inflate requested here"); } mListener = listener; RowAsyncLayoutInflater asyncLayoutFactory = makeRowInflater(entry); RowAsyncLayoutFactory asyncLayoutFactory = makeRowFactory(entry); mEntry = entry; entry.setInflationTask(this); mLogger.logInflateStart(entry); mInflateStartTimeMs = mSystemClock.elapsedRealtime(); if (Flags.useNotifInflationThreadForRow()) { mAsyncRowInflater.inflate(context, asyncLayoutFactory, R.layout.status_bar_notification_row, parent, this); } else { AsyncLayoutInflater inflater = new AsyncLayoutInflater(context, asyncLayoutFactory); inflater.inflate(R.layout.status_bar_notification_row, parent, listenerExecutor, this); } } /** Loading @@ -143,7 +130,7 @@ public class RowInflaterTask implements InflationTask, public ExpandableNotificationRow inflateSynchronously(@NonNull Context context, @Nullable ViewGroup parent, @NonNull NotificationEntry entry) { final LayoutInflater inflater = new BasicRowInflater(context); inflater.setFactory2(makeRowInflater(entry)); inflater.setFactory2(makeRowFactory(entry)); final ExpandableNotificationRow inflate = (ExpandableNotificationRow) inflater.inflate( R.layout.status_bar_notification_row, parent /* root */, Loading @@ -151,20 +138,20 @@ public class RowInflaterTask implements InflationTask, return inflate; } private RowAsyncLayoutInflater makeRowInflater(NotificationEntry entry) { return new RowAsyncLayoutInflater( private RowAsyncLayoutFactory makeRowFactory(NotificationEntry entry) { return new RowAsyncLayoutFactory( entry, mSystemClock, mLogger, mUserTracker.getUserHandle()); } @VisibleForTesting public static class RowAsyncLayoutInflater implements AsyncLayoutFactory { public static class RowAsyncLayoutFactory implements AsyncLayoutFactory { private NotificationEntry mEntry = null; private BundleEntry mBundleEntry = null; private final SystemClock mSystemClock; private final RowInflaterTaskLogger mLogger; private final UserHandle mTargetUser; public RowAsyncLayoutInflater(NotificationEntry entry, SystemClock systemClock, public RowAsyncLayoutFactory(NotificationEntry entry, SystemClock systemClock, RowInflaterTaskLogger logger, UserHandle targetUser) { mEntry = entry; mSystemClock = systemClock; Loading @@ -172,7 +159,7 @@ public class RowInflaterTask implements InflationTask, mTargetUser = targetUser; } public RowAsyncLayoutInflater(BundleEntry entry, SystemClock systemClock, public RowAsyncLayoutFactory(BundleEntry entry, SystemClock systemClock, RowInflaterTaskLogger logger, UserHandle targetUser) { mBundleEntry = entry; mSystemClock = systemClock; Loading packages/SystemUI/src/com/android/systemui/util/kotlin/SysUICoroutinesModule.kt +2 −7 Original line number Diff line number Diff line Loading @@ -130,13 +130,8 @@ class SysUICoroutinesModule { @NotifInflation @SysUISingleton fun notifInflationCoroutineDispatcher( @NotifInflation notifInflationExecutor: Executor, @Background bgCoroutineDispatcher: CoroutineDispatcher, @NotifInflation notifInflationExecutor: Executor ): CoroutineDispatcher { if (com.android.systemui.Flags.useNotifInflationThreadForFooter()) { return notifInflationExecutor.asCoroutineDispatcher() } else { return bgCoroutineDispatcher } } } Loading
packages/SystemUI/aconfig/systemui.aconfig +0 −20 Original line number Diff line number Diff line Loading @@ -897,26 +897,6 @@ flag { } } flag { name: "use_notif_inflation_thread_for_footer" namespace: "systemui" description: "use the @NotifInflation thread for FooterView and EmptyShadeView inflation" bug: "375320642" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "use_notif_inflation_thread_for_row" namespace: "systemui" description: "use the @NotifInflation thread for ExpandableNotificationRow inflation" bug: "375320642" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "notify_power_manager_user_activity_background" namespace: "systemui" Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ public class DynamicChildBindControllerTest extends SysuiTestCase { private ExpandableNotificationRow createRow(NotificationEntry entry) { LayoutInflater inflater = LayoutInflater.from(mContext); inflater.setFactory2( new RowInflaterTask.RowAsyncLayoutInflater(entry, new FakeSystemClock(), mock( new RowInflaterTask.RowAsyncLayoutFactory(entry, new FakeSystemClock(), mock( RowInflaterTaskLogger.class), mContext.getUser())); ExpandableNotificationRow row = (ExpandableNotificationRow) Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/RowInflaterTask.java +14 −27 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; import androidx.asynclayoutinflater.view.AsyncLayoutFactory; import androidx.asynclayoutinflater.view.AsyncLayoutInflater; import com.android.systemui.Flags; import com.android.systemui.res.R; Loading @@ -49,8 +48,7 @@ import javax.inject.Inject; /** * An inflater task that asynchronously inflates a ExpandableNotificationRow */ public class RowInflaterTask implements InflationTask, AsyncLayoutInflater.OnInflateFinishedListener, AsyncRowInflater.OnInflateFinishedListener { public class RowInflaterTask implements InflationTask, AsyncRowInflater.OnInflateFinishedListener { private static final String TAG = "RowInflaterTask"; private static final boolean TRACE_ORIGIN = true; Loading Loading @@ -95,17 +93,11 @@ public class RowInflaterTask implements InflationTask, } mBundleEntry = entry; mListener = listener; RowAsyncLayoutInflater asyncLayoutFactory = new RowAsyncLayoutInflater( RowAsyncLayoutFactory asyncLayoutFactory = new RowAsyncLayoutFactory( entry, mSystemClock, mLogger, mUserTracker.getUserHandle()); if (Flags.useNotifInflationThreadForRow()) { debugBundleLog(TAG, () -> "mAsyncRowInflater.inflate bundle: " + entry.getKey()); mAsyncRowInflater.inflate(context, asyncLayoutFactory, R.layout.status_bar_notification_row, parent, this); } else { debugBundleLog(TAG, () -> "AsyncLayoutInflater.inflate bundle: " + entry.getKey()); AsyncLayoutInflater inflater = new AsyncLayoutInflater(context, asyncLayoutFactory); inflater.inflate(R.layout.status_bar_notification_row, parent, listenerExecutor, this); } } /** Loading @@ -120,19 +112,14 @@ public class RowInflaterTask implements InflationTask, mInflateOrigin = new Throwable("inflate requested here"); } mListener = listener; RowAsyncLayoutInflater asyncLayoutFactory = makeRowInflater(entry); RowAsyncLayoutFactory asyncLayoutFactory = makeRowFactory(entry); mEntry = entry; entry.setInflationTask(this); mLogger.logInflateStart(entry); mInflateStartTimeMs = mSystemClock.elapsedRealtime(); if (Flags.useNotifInflationThreadForRow()) { mAsyncRowInflater.inflate(context, asyncLayoutFactory, R.layout.status_bar_notification_row, parent, this); } else { AsyncLayoutInflater inflater = new AsyncLayoutInflater(context, asyncLayoutFactory); inflater.inflate(R.layout.status_bar_notification_row, parent, listenerExecutor, this); } } /** Loading @@ -143,7 +130,7 @@ public class RowInflaterTask implements InflationTask, public ExpandableNotificationRow inflateSynchronously(@NonNull Context context, @Nullable ViewGroup parent, @NonNull NotificationEntry entry) { final LayoutInflater inflater = new BasicRowInflater(context); inflater.setFactory2(makeRowInflater(entry)); inflater.setFactory2(makeRowFactory(entry)); final ExpandableNotificationRow inflate = (ExpandableNotificationRow) inflater.inflate( R.layout.status_bar_notification_row, parent /* root */, Loading @@ -151,20 +138,20 @@ public class RowInflaterTask implements InflationTask, return inflate; } private RowAsyncLayoutInflater makeRowInflater(NotificationEntry entry) { return new RowAsyncLayoutInflater( private RowAsyncLayoutFactory makeRowFactory(NotificationEntry entry) { return new RowAsyncLayoutFactory( entry, mSystemClock, mLogger, mUserTracker.getUserHandle()); } @VisibleForTesting public static class RowAsyncLayoutInflater implements AsyncLayoutFactory { public static class RowAsyncLayoutFactory implements AsyncLayoutFactory { private NotificationEntry mEntry = null; private BundleEntry mBundleEntry = null; private final SystemClock mSystemClock; private final RowInflaterTaskLogger mLogger; private final UserHandle mTargetUser; public RowAsyncLayoutInflater(NotificationEntry entry, SystemClock systemClock, public RowAsyncLayoutFactory(NotificationEntry entry, SystemClock systemClock, RowInflaterTaskLogger logger, UserHandle targetUser) { mEntry = entry; mSystemClock = systemClock; Loading @@ -172,7 +159,7 @@ public class RowInflaterTask implements InflationTask, mTargetUser = targetUser; } public RowAsyncLayoutInflater(BundleEntry entry, SystemClock systemClock, public RowAsyncLayoutFactory(BundleEntry entry, SystemClock systemClock, RowInflaterTaskLogger logger, UserHandle targetUser) { mBundleEntry = entry; mSystemClock = systemClock; Loading
packages/SystemUI/src/com/android/systemui/util/kotlin/SysUICoroutinesModule.kt +2 −7 Original line number Diff line number Diff line Loading @@ -130,13 +130,8 @@ class SysUICoroutinesModule { @NotifInflation @SysUISingleton fun notifInflationCoroutineDispatcher( @NotifInflation notifInflationExecutor: Executor, @Background bgCoroutineDispatcher: CoroutineDispatcher, @NotifInflation notifInflationExecutor: Executor ): CoroutineDispatcher { if (com.android.systemui.Flags.useNotifInflationThreadForFooter()) { return notifInflationExecutor.asCoroutineDispatcher() } else { return bgCoroutineDispatcher } } }