Add flag to control whether or not we should tint icons

Fix: 34365726
Test: robotests
Change-Id: Ic08d8590c9867fb0383da03f05237f74644a77ff
This commit is contained in:
Fan Zhang
2017-04-28 09:11:28 -07:00
parent d0417e42f0
commit 0a257ee1ba
6 changed files with 43 additions and 13 deletions

View File

@@ -20,6 +20,7 @@ import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
import android.os.Bundle;
@@ -364,4 +365,16 @@ public class DashboardFeatureProviderImplTest {
public void testGetExtraIntentAction_shouldReturnNull() {
assertThat(mImpl.getExtraIntentAction()).isNull();
}
@Test
public void testShouldTintIcon_shouldReturnValueFromResource() {
final Resources res = mActivity.getApplicationContext().getResources();
when(res.getBoolean(R.bool.config_tintSettingIcon))
.thenReturn(false);
assertThat(mImpl.shouldTintIcon()).isFalse();
when(res.getBoolean(R.bool.config_tintSettingIcon))
.thenReturn(true);
assertThat(mImpl.shouldTintIcon()).isTrue();
}
}