Misc fixes for IA and pattern.

Disable NFC fragments when feature is not avaiable
Link to spell checker screen with the pref is clicked
Tint "add"/"delete" button in UserDictionary actionbar to proper color.

Change-Id: I8a8e219ce3dbbafc6c4d5a0f34f835ffd0abad4f
Fix: 34155679
Fix: 34161006
Fix: 34154795
Test: RunSettingsRoboTests
This commit is contained in:
Fan Zhang
2017-01-09 10:16:49 -08:00
parent c4372f1a48
commit ffd328b071
5 changed files with 14 additions and 7 deletions

View File

@@ -31,8 +31,8 @@ import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
import org.robolectric.shadows.ShadowApplication;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.mock;
@@ -53,7 +53,7 @@ public class SpellCheckerPreferenceControllerTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mAppContext = ShadowApplication.getInstance().getApplicationContext();
mAppContext = RuntimeEnvironment.application;
when(mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE))
.thenReturn(mTextServicesManager);
mPreference = new Preference(mAppContext);
@@ -76,7 +76,6 @@ public class SpellCheckerPreferenceControllerTest {
when(mTextServicesManager.isSpellCheckerEnabled()).thenReturn(false);
mController.updateState(mPreference);
assertThat(mPreference.getSummary())
.isEqualTo(mAppContext.getString(R.string.switch_off_text));
}