Add "Hub Mode" settings to mobile settings.
Bug: 389782624 Test: atest CommunalPreferenceControllerTest WhenToDreamPreferenceControllerTest Flag: com.android.settings.flags.enable_hub_mode_settings_on_mobile Change-Id: Ic823b43e094722e467bcca5c16fc480af11e2d9e
This commit is contained in:
@@ -21,6 +21,7 @@ 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.
|
||||
@@ -39,7 +40,14 @@ public class CommunalPreferenceController extends BasePreferenceController {
|
||||
* Returns whether communal preferences are available.
|
||||
*/
|
||||
public static boolean isAvailable(Context context) {
|
||||
return context.getResources().getBoolean(R.bool.config_show_communal_settings)
|
||||
&& Utils.canCurrentUserDream(context);
|
||||
if (context.getResources().getBoolean(R.bool.config_show_communal_settings)) {
|
||||
return Utils.canCurrentUserDream(context);
|
||||
}
|
||||
|
||||
if (context.getResources().getBoolean(R.bool.config_show_communal_settings_mobile)) {
|
||||
return Flags.enableHubModeSettingsOnMobile() && Utils.canCurrentUserDream(context);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user