Merge changes I9025a0a3,I48a1d380 into udc-qpr-dev
* changes: Add the COMPOSE_QS_FOOTER_ACTIONS flag Add the COMPOSE_PEOPLE_SPACE flag
This commit is contained in:
committed by
Android (Google) Code Review
commit
77bfa87487
@@ -735,4 +735,12 @@ object Flags {
|
||||
// TODO(b/290213663): Tracking Bug
|
||||
@JvmField
|
||||
val ONE_WAY_HAPTICS_API_MIGRATION = unreleasedFlag(3100, "oneway_haptics_api_migration")
|
||||
|
||||
/** Enable the Compose implementation of the PeopleSpaceActivity. */
|
||||
@JvmField
|
||||
val COMPOSE_PEOPLE_SPACE = unreleasedFlag(293570761, "compose_people_space")
|
||||
|
||||
/** Enable the Compose implementation of the Quick Settings footer actions. */
|
||||
@JvmField
|
||||
val COMPOSE_QS_FOOTER_ACTIONS = unreleasedFlag(293569320, "compose_qs_footer_actions")
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ import androidx.activity.ComponentActivity;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import com.android.systemui.compose.ComposeFacade;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.people.ui.view.PeopleViewBinder;
|
||||
import com.android.systemui.people.ui.viewmodel.PeopleViewModel;
|
||||
|
||||
@@ -43,11 +45,14 @@ public class PeopleSpaceActivity extends ComponentActivity {
|
||||
private static final boolean DEBUG = PeopleSpaceUtils.DEBUG;
|
||||
|
||||
private final PeopleViewModel.Factory mViewModelFactory;
|
||||
private final FeatureFlags mFeatureFlags;
|
||||
|
||||
@Inject
|
||||
public PeopleSpaceActivity(PeopleViewModel.Factory viewModelFactory) {
|
||||
public PeopleSpaceActivity(PeopleViewModel.Factory viewModelFactory,
|
||||
FeatureFlags featureFlags) {
|
||||
super();
|
||||
mViewModelFactory = viewModelFactory;
|
||||
mFeatureFlags = featureFlags;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +72,8 @@ public class PeopleSpaceActivity extends ComponentActivity {
|
||||
return null;
|
||||
};
|
||||
|
||||
if (ComposeFacade.INSTANCE.isComposeAvailable()) {
|
||||
if (mFeatureFlags.isEnabled(Flags.COMPOSE_PEOPLE_SPACE)
|
||||
&& ComposeFacade.INSTANCE.isComposeAvailable()) {
|
||||
Log.d(TAG, "Using the Compose implementation of the PeopleSpaceActivity");
|
||||
ComposeFacade.INSTANCE.setPeopleSpaceActivityContent(this, viewModel, onResult);
|
||||
} else {
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.android.systemui.animation.ShadeInterpolation;
|
||||
import com.android.systemui.compose.ComposeFacade;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.flags.FeatureFlags;
|
||||
import com.android.systemui.flags.Flags;
|
||||
import com.android.systemui.media.controls.ui.MediaHost;
|
||||
import com.android.systemui.plugins.qs.QS;
|
||||
import com.android.systemui.plugins.qs.QSContainerController;
|
||||
@@ -285,7 +286,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
|
||||
private void bindFooterActionsView(View root) {
|
||||
LinearLayout footerActionsView = root.findViewById(R.id.qs_footer_actions);
|
||||
|
||||
if (!ComposeFacade.INSTANCE.isComposeAvailable()) {
|
||||
if (!mFeatureFlags.isEnabled(Flags.COMPOSE_QS_FOOTER_ACTIONS)
|
||||
|| !ComposeFacade.INSTANCE.isComposeAvailable()) {
|
||||
Log.d(TAG, "Binding the View implementation of the QS footer actions");
|
||||
mFooterActionsViewBinder.bind(footerActionsView, mQSFooterActionsViewModel,
|
||||
mListeningAndVisibilityLifecycleOwner);
|
||||
|
||||
Reference in New Issue
Block a user