Move host constraint builder logic to the concrete wrapper implementation.
Fix build. Bug: 408283627 Flag: EXEMPT independent module Test: See demo Change-Id: Ic15eb61eaa76ee9eeb1680dfe90cb89442f7d159
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
package com.android.launcher3.widgetpicker
|
||||
|
||||
import android.os.UserHandle
|
||||
import com.android.launcher3.widgetpicker.shared.model.HostConstraint
|
||||
|
||||
/**
|
||||
* Possible parameters sent over by the widget host when launching the widget picker activity.
|
||||
@@ -58,23 +57,5 @@ data class WidgetPickerConfig(
|
||||
const val EXTRA_IS_PENDING_WIDGET_DRAG = "is_pending_widget_drag"
|
||||
|
||||
const val HOMESCREEN_WIDGETS_UI_SURFACE = "widgets"
|
||||
|
||||
/** Builds the host constraints to provide to the widget picker module. */
|
||||
fun WidgetPickerConfig.asHostConstraints() =
|
||||
buildList {
|
||||
if (filteredUsers.isNotEmpty()) {
|
||||
add(HostConstraint.HostUserConstraint(filteredUsers))
|
||||
}
|
||||
if (categoryInclusionFilter != 0
|
||||
|| categoryExclusionFilter != 0
|
||||
) {
|
||||
add(
|
||||
HostConstraint.HostCategoryConstraint(
|
||||
categoryInclusionMask = categoryInclusionFilter,
|
||||
categoryExclusionMask = categoryExclusionFilter,
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user