Misc fixes for Settings

- Add some precautious logging in RoundedHomepageIcon in case b/79841665
  comes back.
- Hide memory setting from app info page.

Change-Id: I37d090504ab25854e1278aa3a6d3e85781f394b1
Fixes: 79841665
Fixes: 80140797
Test: visual
This commit is contained in:
Fan Zhang
2018-05-29 13:50:29 -07:00
parent 828409a79d
commit 8379a09554
4 changed files with 10 additions and 5 deletions

View File

@@ -58,7 +58,7 @@
<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>
<bool name="config_show_app_info_settings_memory">false</bool>
<!-- Whether battery from app_info_settings is available or not. -->
<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.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import androidx.annotation.VisibleForTesting;
import android.util.Log;
import com.android.settings.R;
import androidx.annotation.VisibleForTesting;
public class RoundedHomepageIcon extends LayerDrawable {
private static final String TAG = "RoundedHomepageIcon";
@VisibleForTesting(otherwise = NONE)
int mBackgroundColor = -1;
@@ -44,5 +48,6 @@ public class RoundedHomepageIcon extends LayerDrawable {
public void setBackgroundColor(int color) {
mBackgroundColor = color;
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_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_memory">true</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>

View File

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