Loading res/values/bools.xml +6 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,12 @@ <!-- Whether toggle_airplane is available or not. --> <bool name="config_show_toggle_airplane">true</bool> <!-- Whether memory from app_info_settings is available or not. --> <bool name="config_show_app_info_settings_memory">true</bool> <!-- Whether battery from app_info_settings is available or not. --> <bool name="config_show_app_info_settings_battery">true</bool> <!-- Whether location mode is available or not. --> <bool name="config_location_mode_available">true</bool> Loading src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java +3 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ public class AppBatteryPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { return AVAILABLE; return mContext.getResources().getBoolean(R.bool.config_show_app_info_settings_battery) ? AVAILABLE : DISABLED_UNSUPPORTED; } @Override Loading src/com/android/settings/applications/appinfo/AppMemoryPreferenceController.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public class AppMemoryPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { if (!mContext.getResources().getBoolean(R.bool.config_show_app_info_settings_memory)) { return DISABLED_UNSUPPORTED; } return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext) ? AVAILABLE : DISABLED_DEPENDENT_SETTING; } Loading tests/robotests/res/values-mcc999/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ <bool name="config_additional_system_update_setting_enable">true</bool> <bool name="config_show_wifi_settings">false</bool> <bool name="config_show_toggle_airplane">false</bool> <bool name="config_show_app_info_settings_memory">false</bool> <bool name="config_show_app_info_settings_battery">false</bool> <bool name="config_show_high_power_apps">false</bool> <bool name="config_show_alarm_volume">false</bool> <bool name="config_show_charging_sounds">false</bool> Loading tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -109,8 +109,14 @@ public class AppBatteryPreferenceControllerTest { } @Test public void getAvailabilityStatus_shouldAlwaysReturnAvailable() { assertThat(mController.getAvailabilityStatus()).isEqualTo(mController.AVAILABLE); public void testAppBattery_byDefault_shouldBeShown() { assertThat(mController.isAvailable()).isTrue(); } @Test @Config(qualifiers = "mcc999") public void testAppBattery_ifDisabled_shouldNotBeShown() { assertThat(mController.isAvailable()).isFalse(); } @Test Loading Loading
res/values/bools.xml +6 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,12 @@ <!-- Whether toggle_airplane is available or not. --> <bool name="config_show_toggle_airplane">true</bool> <!-- Whether memory from app_info_settings is available or not. --> <bool name="config_show_app_info_settings_memory">true</bool> <!-- Whether battery from app_info_settings is available or not. --> <bool name="config_show_app_info_settings_battery">true</bool> <!-- Whether location mode is available or not. --> <bool name="config_location_mode_available">true</bool> Loading
src/com/android/settings/applications/appinfo/AppBatteryPreferenceController.java +3 −1 Original line number Diff line number Diff line Loading @@ -76,7 +76,9 @@ public class AppBatteryPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { return AVAILABLE; return mContext.getResources().getBoolean(R.bool.config_show_app_info_settings_battery) ? AVAILABLE : DISABLED_UNSUPPORTED; } @Override Loading
src/com/android/settings/applications/appinfo/AppMemoryPreferenceController.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ public class AppMemoryPreferenceController extends BasePreferenceController @Override public int getAvailabilityStatus() { if (!mContext.getResources().getBoolean(R.bool.config_show_app_info_settings_memory)) { return DISABLED_UNSUPPORTED; } return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext) ? AVAILABLE : DISABLED_DEPENDENT_SETTING; } Loading
tests/robotests/res/values-mcc999/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,8 @@ <bool name="config_additional_system_update_setting_enable">true</bool> <bool name="config_show_wifi_settings">false</bool> <bool name="config_show_toggle_airplane">false</bool> <bool name="config_show_app_info_settings_memory">false</bool> <bool name="config_show_app_info_settings_battery">false</bool> <bool name="config_show_high_power_apps">false</bool> <bool name="config_show_alarm_volume">false</bool> <bool name="config_show_charging_sounds">false</bool> Loading
tests/robotests/src/com/android/settings/applications/appinfo/AppBatteryPreferenceControllerTest.java +8 −2 Original line number Diff line number Diff line Loading @@ -109,8 +109,14 @@ public class AppBatteryPreferenceControllerTest { } @Test public void getAvailabilityStatus_shouldAlwaysReturnAvailable() { assertThat(mController.getAvailabilityStatus()).isEqualTo(mController.AVAILABLE); public void testAppBattery_byDefault_shouldBeShown() { assertThat(mController.isAvailable()).isTrue(); } @Test @Config(qualifiers = "mcc999") public void testAppBattery_ifDisabled_shouldNotBeShown() { assertThat(mController.isAvailable()).isFalse(); } @Test Loading