Fix top level "Gestures" not appearing in search result

If the availability status equals AVAILABLE_UNSEARCHABLE,
the preference won't appear in the serch result so we change
the status to AVAILABLE.

Change-Id: Id3ab28c4974f42be9b06a58d9c0d284f23ef160f
Fixes: 117951603
Test: manual and robotests
This commit is contained in:
Stanley Wang
2018-11-30 16:52:46 +08:00
parent 0173c5f532
commit 9c4e2d6767
2 changed files with 5 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ public class GesturesSettingPreferenceController extends BasePreferenceControlle
for (AbstractPreferenceController controller : mGestureControllers) {
isAvailable = isAvailable || controller.isAvailable();
}
return isAvailable ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
return isAvailable ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}
/**

View File

@@ -16,6 +16,8 @@
package com.android.settings.gestures;
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Matchers.any;
@@ -81,7 +83,7 @@ public class GesturesSettingsPreferenceControllerTest {
});
ReflectionHelpers.setField(mController, "mGestureControllers", mControllers);
assertThat(mController.isAvailable()).isTrue();
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
@Test