Merge "Only show "hub mode" settings when the glanceable_hub_v2 flag is true." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
e732852cfb
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user