Add ability to show/hide System Update.

This adds one flag:
config_show_system_update_settings

Which when set to false will hide "System update" from System page. This
is useful for devices that controls its system update elsewhere.

Bug: 69813881
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=com.android.settings.deviceinfo
Change-Id: Ibd1291ffd8948419e8aa06d0721842246a069378
This commit is contained in:
Ben Lin
2018-01-23 11:32:46 -08:00
parent 2a63861a52
commit 6fb9c9f4b0
4 changed files with 33 additions and 15 deletions

View File

@@ -47,7 +47,8 @@ public class SystemUpdatePreferenceController extends BasePreferenceController {
@Override
public int getAvailabilityStatus() {
return mUm.isAdminUser()
return mContext.getResources().getBoolean(R.bool.config_show_system_update_settings)
&& mUm.isAdminUser()
? AVAILABLE
: DISABLED_UNSUPPORTED;
}