Merge "Only show "hub mode" settings when the glanceable_hub_v2 flag is true." into main

This commit is contained in:
William Leshner
2025-02-13 11:46:32 -08:00
committed by Android (Google) Code Review
4 changed files with 15 additions and 13 deletions

View File

@@ -21,7 +21,6 @@ import android.content.Context;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.flags.Flags;
/**
* Controls the top-level Communal settings preference.
@@ -40,14 +39,15 @@ public class CommunalPreferenceController extends BasePreferenceController {
* Returns whether communal preferences are available.
*/
public static boolean isAvailable(Context context) {
if (!Utils.canCurrentUserDream(context)) {
return false;
}
if (context.getResources().getBoolean(R.bool.config_show_communal_settings)) {
return Utils.canCurrentUserDream(context);
return true;
}
if (context.getResources().getBoolean(R.bool.config_show_communal_settings_mobile)) {
return Flags.enableHubModeSettingsOnMobile() && Utils.canCurrentUserDream(context);
}
return false;
return com.android.systemui.Flags.glanceableHubV2()
&& context.getResources().getBoolean(R.bool.config_show_communal_settings_mobile);
}
}