Only show "hub mode" settings when the glanceable_hub_v2 flag is true.
Bug: 395320922 Test: atest CommunalPreferenceControllerTest Flag: com.android.systemui.glanceable_hub_v2 Change-Id: I46e5931205a219806917fafcc1a7aac3b7046796
This commit is contained in:
@@ -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