Merge "Misc fixes for Settings"

This commit is contained in:
TreeHugger Robot
2018-05-30 00:26:48 +00:00
committed by Android (Google) Code Review
4 changed files with 10 additions and 5 deletions

View File

@@ -58,7 +58,7 @@
<bool name="config_show_toggle_airplane">true</bool> <bool name="config_show_toggle_airplane">true</bool>
<!-- Whether memory from app_info_settings is available or not. --> <!-- Whether memory from app_info_settings is available or not. -->
<bool name="config_show_app_info_settings_memory">true</bool> <bool name="config_show_app_info_settings_memory">false</bool>
<!-- Whether battery from app_info_settings is available or not. --> <!-- Whether battery from app_info_settings is available or not. -->
<bool name="config_show_app_info_settings_battery">true</bool> <bool name="config_show_app_info_settings_battery">true</bool>

View File

@@ -22,12 +22,16 @@ import android.content.Context;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.LayerDrawable;
import androidx.annotation.VisibleForTesting; import android.util.Log;
import com.android.settings.R; import com.android.settings.R;
import androidx.annotation.VisibleForTesting;
public class RoundedHomepageIcon extends LayerDrawable { public class RoundedHomepageIcon extends LayerDrawable {
private static final String TAG = "RoundedHomepageIcon";
@VisibleForTesting(otherwise = NONE) @VisibleForTesting(otherwise = NONE)
int mBackgroundColor = -1; int mBackgroundColor = -1;
@@ -44,5 +48,6 @@ public class RoundedHomepageIcon extends LayerDrawable {
public void setBackgroundColor(int color) { public void setBackgroundColor(int color) {
mBackgroundColor = color; mBackgroundColor = color;
getDrawable(0).setColorFilter(color, PorterDuff.Mode.SRC_ATOP); getDrawable(0).setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
Log.d(TAG, "Setting background color " + mBackgroundColor);
} }
} }

View File

@@ -23,7 +23,7 @@
<bool name="config_additional_system_update_setting_enable">true</bool> <bool name="config_additional_system_update_setting_enable">true</bool>
<bool name="config_show_wifi_settings">false</bool> <bool name="config_show_wifi_settings">false</bool>
<bool name="config_show_toggle_airplane">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_memory">true</bool>
<bool name="config_show_app_info_settings_battery">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_high_power_apps">false</bool>
<bool name="config_show_alarm_volume">false</bool> <bool name="config_show_alarm_volume">false</bool>

View File

@@ -76,6 +76,7 @@ public class AppMemoryPreferenceControllerTest {
} }
@Test @Test
@Config(qualifiers = "mcc999")
public void getAvailabilityStatus_developmentSettingsEnabled_shouldReturnAvailable() { public void getAvailabilityStatus_developmentSettingsEnabled_shouldReturnAvailable() {
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1); Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
@@ -85,7 +86,6 @@ public class AppMemoryPreferenceControllerTest {
} }
@Test @Test
@Config(qualifiers = "mcc999")
public void getAvailabilityStatus_devSettingsEnabled_butNotVisible_shouldReturnUnsupported() { public void getAvailabilityStatus_devSettingsEnabled_butNotVisible_shouldReturnUnsupported() {
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1); Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
@@ -95,7 +95,6 @@ public class AppMemoryPreferenceControllerTest {
} }
@Test @Test
@Config(qualifiers = "mcc999")
public void getAvailabilityStatus_devSettingsDisabled_butNotVisible_shouldReturnUnsupported() { public void getAvailabilityStatus_devSettingsDisabled_butNotVisible_shouldReturnUnsupported() {
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0); Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
@@ -105,6 +104,7 @@ public class AppMemoryPreferenceControllerTest {
} }
@Test @Test
@Config(qualifiers = "mcc999")
public void getAvailabilityStatus_developmentSettingsDisabled_shouldReturnDisabled() { public void getAvailabilityStatus_developmentSettingsDisabled_shouldReturnDisabled() {
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0); Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);