Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e866cd48 authored by Doris Ling's avatar Doris Ling Committed by android-build-merger
Browse files

Merge "Fix gestures summary text when there is no sensor for assit." into oc-mr1-dev

am: 8e13218e

Change-Id: Ie0b5b306e00e6bb62e5385caabdf306c98fb8c05
parents 220b1f16 8e13218e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ public class GesturesSettingPreferenceController extends AbstractPreferenceContr
    public void updateState(Preference preference) {
        if (!mFeatureProvider.isSensorAvailable(mContext)) {
            preference.setSummary("");
            return;
        }
        final ContentResolver contentResolver = mContext.getContentResolver();
        final boolean assistGestureEnabled = Settings.Secure.getInt(
+12 −0
Original line number Diff line number Diff line
@@ -119,4 +119,16 @@ public class GesturesSettingsPreferenceControllerTest {
        verify(mActivity).getString(R.string.language_input_gesture_summary_on_non_assist);
    }

    @Test
    @Config(shadows = {ShadowSecureSettings.class})
    public void updateState_sensorNotAvailable_shouldSetToEmptyStatus() {
        final FakeFeatureFactory featureFactory =
                (FakeFeatureFactory) FakeFeatureFactory.getFactory(mActivity);
        when(featureFactory.assistGestureFeatureProvider.isSensorAvailable(any(Context.class)))
                .thenReturn(false);

        mController.updateState(mPreference);
        verify(mPreference).setSummary("");
    }

}