Move hub mode settings under display.

And add a "when to show" setting.

Bug: 401001786
Test: manually
Flag: com.android.systemui.glanceable_hub_v2

Change-Id: I5f660a1be4bdbb5ab5bb14aa070bfa81b31da6b4
This commit is contained in:
Will Leshner
2025-03-05 14:28:40 -08:00
parent e5e3803470
commit 417b667be4
11 changed files with 458 additions and 44 deletions

View File

@@ -39,15 +39,14 @@ public class CommunalPreferenceController extends BasePreferenceController {
* Returns whether communal preferences are available.
*/
public static boolean isAvailable(Context context) {
if (com.android.systemui.Flags.glanceableHubV2()) {
return false;
}
if (!Utils.canCurrentUserDream(context)) {
return false;
}
if (context.getResources().getBoolean(R.bool.config_show_communal_settings)) {
return true;
}
return com.android.systemui.Flags.glanceableHubV2()
&& context.getResources().getBoolean(R.bool.config_show_communal_settings_mobile);
return context.getResources().getBoolean(R.bool.config_show_communal_settings);
}
}