Fix the problem that some items can't be searched in Privacy category.
The source of problem is that the controller returns the wrong availability status value and the searchable attribut of the preference is false. Fix: 200249682 Test: manual test and see the search result Change-Id: I2265514c49303f6a0910f1be84b281fccb9abb45
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.settings.privacy;
|
||||
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.AVAILABLE;
|
||||
import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
@@ -33,8 +33,8 @@ import com.android.settings.enterprise.EnterprisePrivacyFeatureProvider;
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
@@ -64,12 +64,12 @@ public class WorkPolicyInfoPreferenceControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getAvailabilityStatus_haveWorkPolicyInfo_shouldReturnAvailableUnsearchable() {
|
||||
public void getAvailabilityStatus_haveWorkPolicyInfo_shouldReturnAvailable() {
|
||||
when(mEnterpriseProvider.hasWorkPolicyInfo()).thenReturn(true);
|
||||
WorkPolicyInfoPreferenceController controller =
|
||||
new WorkPolicyInfoPreferenceController(mContext, "test_key");
|
||||
|
||||
assertThat(controller.getAvailabilityStatus()).isEqualTo(AVAILABLE_UNSEARCHABLE);
|
||||
assertThat(controller.getAvailabilityStatus()).isEqualTo(AVAILABLE);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user