Merge changes I3ac6506a,I3fc80505
* changes: Add intent-filter to SearchResultTrampoline Create a feature flag for Search v2.
This commit is contained in:
committed by
Android (Google) Code Review
commit
29b14a70d5
@@ -223,6 +223,10 @@
|
|||||||
android:theme="@android:style/Theme.NoDisplay"
|
android:theme="@android:style/Theme.NoDisplay"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="com.android.settings.SEARCH_RESULT_TRAMPOLINE" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<!-- Top-level settings -->
|
<!-- Top-level settings -->
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
|
import static com.android.settings.core.FeatureFlags.DEVICE_INFO_V2;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -56,8 +58,6 @@ import java.util.List;
|
|||||||
|
|
||||||
public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
||||||
|
|
||||||
public static final String DEVICE_INFO_V2_FEATURE_FLAG = "device_info_v2";
|
|
||||||
|
|
||||||
private static final String LOG_TAG = "DeviceInfoSettings";
|
private static final String LOG_TAG = "DeviceInfoSettings";
|
||||||
|
|
||||||
private static final String KEY_LEGAL_CONTAINER = "legal_container";
|
private static final String KEY_LEGAL_CONTAINER = "legal_container";
|
||||||
@@ -89,7 +89,7 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getPreferenceScreenResId() {
|
protected int getPreferenceScreenResId() {
|
||||||
return FeatureFlagUtils.isEnabled(DEVICE_INFO_V2_FEATURE_FLAG)
|
return FeatureFlagUtils.isEnabled(DEVICE_INFO_V2)
|
||||||
? R.xml.device_info_settings_v2 : R.xml.device_info_settings;
|
? R.xml.device_info_settings_v2 : R.xml.device_info_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ public class DeviceInfoSettings extends DashboardFragment implements Indexable {
|
|||||||
|
|
||||||
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
|
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
|
||||||
Activity activity, Fragment fragment, Lifecycle lifecycle) {
|
Activity activity, Fragment fragment, Lifecycle lifecycle) {
|
||||||
if (FeatureFlagUtils.isEnabled(DEVICE_INFO_V2_FEATURE_FLAG)) {
|
if (FeatureFlagUtils.isEnabled(DEVICE_INFO_V2)) {
|
||||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||||
// Device name
|
// Device name
|
||||||
|
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
|
import static com.android.settings.core.FeatureFlags.DEV_OPTION_V1;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
@@ -65,7 +67,7 @@ public class Settings extends SettingsActivity {
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public static class DevelopmentSettingsActivity extends SettingsActivity {
|
public static class DevelopmentSettingsActivity extends SettingsActivity {
|
||||||
public static final boolean isEnabled() {
|
public static final boolean isEnabled() {
|
||||||
return FeatureFlagUtils.isEnabled("dev_option_v1");
|
return FeatureFlagUtils.isEnabled(DEV_OPTION_V1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static class DevelopmentSettingsDashboardActivity extends SettingsActivity { /* empty */ }
|
public static class DevelopmentSettingsDashboardActivity extends SettingsActivity { /* empty */ }
|
||||||
|
@@ -62,7 +62,6 @@ import com.android.settings.core.instrumentation.SharedPreferencesLogger;
|
|||||||
import com.android.settings.dashboard.DashboardFeatureProvider;
|
import com.android.settings.dashboard.DashboardFeatureProvider;
|
||||||
import com.android.settings.dashboard.DashboardSummary;
|
import com.android.settings.dashboard.DashboardSummary;
|
||||||
import com.android.settings.overlay.FeatureFactory;
|
import com.android.settings.overlay.FeatureFactory;
|
||||||
import com.android.settings.search.SearchActivity;
|
|
||||||
import com.android.settings.wfd.WifiDisplaySettings;
|
import com.android.settings.wfd.WifiDisplaySettings;
|
||||||
import com.android.settings.widget.SwitchBar;
|
import com.android.settings.widget.SwitchBar;
|
||||||
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
import com.android.settingslib.development.DevelopmentSettingsEnabler;
|
||||||
@@ -76,7 +75,7 @@ import java.util.Set;
|
|||||||
public class SettingsActivity extends SettingsDrawerActivity
|
public class SettingsActivity extends SettingsDrawerActivity
|
||||||
implements PreferenceManager.OnPreferenceTreeClickListener,
|
implements PreferenceManager.OnPreferenceTreeClickListener,
|
||||||
PreferenceFragment.OnPreferenceStartFragmentCallback,
|
PreferenceFragment.OnPreferenceStartFragmentCallback,
|
||||||
ButtonBarHandler, FragmentManager.OnBackStackChangedListener, OnClickListener {
|
ButtonBarHandler, FragmentManager.OnBackStackChangedListener {
|
||||||
|
|
||||||
private static final String LOG_TAG = "Settings";
|
private static final String LOG_TAG = "Settings";
|
||||||
|
|
||||||
@@ -329,8 +328,9 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
if (mIsShowingDashboard) {
|
if (mIsShowingDashboard) {
|
||||||
findViewById(R.id.search_bar).setVisibility(View.VISIBLE);
|
findViewById(R.id.search_bar).setVisibility(View.VISIBLE);
|
||||||
findViewById(R.id.action_bar).setVisibility(View.GONE);
|
findViewById(R.id.action_bar).setVisibility(View.GONE);
|
||||||
Toolbar toolbar = findViewById(R.id.search_action_bar);
|
final Toolbar toolbar = findViewById(R.id.search_action_bar);
|
||||||
toolbar.setOnClickListener(this);
|
FeatureFactory.getFactory(this).getSearchFeatureProvider()
|
||||||
|
.initSearchToolbar(this, toolbar);
|
||||||
setActionBar(toolbar);
|
setActionBar(toolbar);
|
||||||
|
|
||||||
// Please forgive me for what I am about to do.
|
// Please forgive me for what I am about to do.
|
||||||
@@ -959,10 +959,4 @@ public class SettingsActivity extends SettingsDrawerActivity
|
|||||||
|
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
Intent intent = new Intent(this, SearchActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
28
src/com/android/settings/core/FeatureFlags.java
Normal file
28
src/com/android/settings/core/FeatureFlags.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.settings.core;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class keeps track of all feature flags in Settings.
|
||||||
|
*/
|
||||||
|
public class FeatureFlags {
|
||||||
|
public static final String DEVICE_INFO_V2 = "device_info_v2";
|
||||||
|
public static final String DEV_OPTION_V1 = "dev_option_v1";
|
||||||
|
public static final String SEARCH_V2 = "settings_search_v2";
|
||||||
|
public static final String SUGGESTIONS_V2 = "new_settings_suggestion";
|
||||||
|
public static final String USE_PREFERENCE_SCREEN_TITLE = "settings_use_preference_screen_title";
|
||||||
|
}
|
@@ -18,7 +18,6 @@ package com.android.settings.core;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.VisibleForTesting;
|
|
||||||
import android.support.annotation.XmlRes;
|
import android.support.annotation.XmlRes;
|
||||||
import android.support.v7.preference.PreferenceScreen;
|
import android.support.v7.preference.PreferenceScreen;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -39,9 +38,8 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
|
|||||||
implements Instrumentable {
|
implements Instrumentable {
|
||||||
|
|
||||||
private static final String TAG = "InstrumentedPrefFrag";
|
private static final String TAG = "InstrumentedPrefFrag";
|
||||||
@VisibleForTesting
|
|
||||||
static final String FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE =
|
|
||||||
"settings_use_preference_screen_title";
|
|
||||||
protected MetricsFeatureProvider mMetricsFeatureProvider;
|
protected MetricsFeatureProvider mMetricsFeatureProvider;
|
||||||
|
|
||||||
// metrics placeholder value. Only use this for development.
|
// metrics placeholder value. Only use this for development.
|
||||||
@@ -85,7 +83,7 @@ public abstract class InstrumentedPreferenceFragment extends ObservablePreferenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean usePreferenceScreenTitle() {
|
public static boolean usePreferenceScreenTitle() {
|
||||||
return FeatureFlagUtils.isEnabled(FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE) || true;
|
return FeatureFlagUtils.isEnabled(FeatureFlags.USE_PREFERENCE_SCREEN_TITLE) || true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final Context getPrefContext() {
|
protected final Context getPrefContext() {
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.dashboard.suggestions;
|
package com.android.settings.dashboard.suggestions;
|
||||||
|
|
||||||
|
import static com.android.settings.core.FeatureFlags.SUGGESTIONS_V2;
|
||||||
|
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
@@ -62,8 +64,6 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
|
|||||||
private static final int EXCLUSIVE_SUGGESTION_MAX_COUNT = 3;
|
private static final int EXCLUSIVE_SUGGESTION_MAX_COUNT = 3;
|
||||||
|
|
||||||
private static final String SHARED_PREF_FILENAME = "suggestions";
|
private static final String SHARED_PREF_FILENAME = "suggestions";
|
||||||
@VisibleForTesting
|
|
||||||
static final String FEATURE_FLAG_SUGGESTIONS_V2 = "new_settings_suggestion";
|
|
||||||
|
|
||||||
private final SuggestionRanker mSuggestionRanker;
|
private final SuggestionRanker mSuggestionRanker;
|
||||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||||
@@ -92,7 +92,7 @@ public class SuggestionFeatureProviderImpl implements SuggestionFeatureProvider
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isV2Enabled() {
|
private static boolean isV2Enabled() {
|
||||||
return FeatureFlagUtils.isEnabled(FEATURE_FLAG_SUGGESTIONS_V2) || true;
|
return FeatureFlagUtils.isEnabled(SUGGESTIONS_V2) || true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -23,8 +23,8 @@ import android.support.v7.preference.PreferenceScreen;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.FeatureFlagUtils;
|
import android.util.FeatureFlagUtils;
|
||||||
|
|
||||||
import com.android.settings.DeviceInfoSettings;
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.core.FeatureFlags;
|
||||||
import com.android.settings.core.PreferenceControllerMixin;
|
import com.android.settings.core.PreferenceControllerMixin;
|
||||||
import com.android.settingslib.DeviceInfoUtils;
|
import com.android.settingslib.DeviceInfoUtils;
|
||||||
import com.android.settingslib.core.AbstractPreferenceController;
|
import com.android.settingslib.core.AbstractPreferenceController;
|
||||||
@@ -51,7 +51,7 @@ public class DeviceModelPreferenceController extends AbstractPreferenceControlle
|
|||||||
super.displayPreference(screen);
|
super.displayPreference(screen);
|
||||||
final Preference pref = screen.findPreference(KEY_DEVICE_MODEL);
|
final Preference pref = screen.findPreference(KEY_DEVICE_MODEL);
|
||||||
if (pref != null) {
|
if (pref != null) {
|
||||||
if (FeatureFlagUtils.isEnabled(DeviceInfoSettings.DEVICE_INFO_V2_FEATURE_FLAG)) {
|
if (FeatureFlagUtils.isEnabled(FeatureFlags.DEVICE_INFO_V2)) {
|
||||||
pref.setSummary(mContext.getResources().getString(R.string.model_summary,
|
pref.setSummary(mContext.getResources().getString(R.string.model_summary,
|
||||||
getDeviceModel()));
|
getDeviceModel()));
|
||||||
} else {
|
} else {
|
||||||
|
@@ -29,8 +29,8 @@ import android.view.View;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto;
|
import com.android.internal.logging.nano.MetricsProto;
|
||||||
import com.android.settings.DeviceInfoSettings;
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.core.FeatureFlags;
|
||||||
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
|
||||||
|
|
||||||
public class HardwareInfoDialogFragment extends InstrumentedDialogFragment {
|
public class HardwareInfoDialogFragment extends InstrumentedDialogFragment {
|
||||||
@@ -59,7 +59,7 @@ public class HardwareInfoDialogFragment extends InstrumentedDialogFragment {
|
|||||||
DeviceModelPreferenceController.getDeviceModel());
|
DeviceModelPreferenceController.getDeviceModel());
|
||||||
|
|
||||||
// Serial number
|
// Serial number
|
||||||
if (FeatureFlagUtils.isEnabled(DeviceInfoSettings.DEVICE_INFO_V2_FEATURE_FLAG)) {
|
if (FeatureFlagUtils.isEnabled(FeatureFlags.DEVICE_INFO_V2)) {
|
||||||
setText(content, R.id.serial_number_label, R.id.serial_number_value, getSerialNumber());
|
setText(content, R.id.serial_number_label, R.id.serial_number_value, getSerialNumber());
|
||||||
} else {
|
} else {
|
||||||
content.findViewById(R.id.serial_number_label).setVisibility(View.GONE);
|
content.findViewById(R.id.serial_number_label).setVisibility(View.GONE);
|
||||||
@@ -73,7 +73,7 @@ public class HardwareInfoDialogFragment extends InstrumentedDialogFragment {
|
|||||||
return builder.setView(content).create();
|
return builder.setView(content).create();
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
@VisibleForTesting
|
||||||
void setText(View content, int labelViewId, int valueViewId, String value) {
|
void setText(View content, int labelViewId, int valueViewId, String value) {
|
||||||
if (content == null) {
|
if (content == null) {
|
||||||
return;
|
return;
|
||||||
|
@@ -60,8 +60,9 @@ public class DatabaseIndexingUtils {
|
|||||||
args.putString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key);
|
args.putString(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key);
|
||||||
final Intent searchDestination = Utils.onBuildStartFragmentIntent(context,
|
final Intent searchDestination = Utils.onBuildStartFragmentIntent(context,
|
||||||
className, args, null, 0, screenTitle, false, sourceMetricsCategory);
|
className, args, null, 0, screenTitle, false, sourceMetricsCategory);
|
||||||
searchDestination.putExtra(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key);
|
searchDestination.putExtra(SettingsActivity.EXTRA_FRAGMENT_ARG_KEY, key)
|
||||||
searchDestination.setClass(context, SearchResultTrampoline.class);
|
.setAction("com.android.settings.SEARCH_RESULT_TRAMPOLINE")
|
||||||
|
.setComponent(null);
|
||||||
return searchDestination;
|
return searchDestination;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,9 +19,13 @@ package com.android.settings.search;
|
|||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.FeatureFlagUtils;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
|
import com.android.settings.core.FeatureFlags;
|
||||||
import com.android.settings.dashboard.SiteMapManager;
|
import com.android.settings.dashboard.SiteMapManager;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -164,4 +168,22 @@ public interface SearchFeatureProvider {
|
|||||||
default FutureTask<List<Pair<String, Float>>> getRankerTask(Context context, String query) {
|
default FutureTask<List<Pair<String, Float>>> getRankerTask(Context context, String query) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initializes the search toolbar.
|
||||||
|
*/
|
||||||
|
default void initSearchToolbar(Context context, Toolbar toolbar) {
|
||||||
|
if (context == null || toolbar == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toolbar.setOnClickListener(tb -> {
|
||||||
|
final Intent intent;
|
||||||
|
if (FeatureFlagUtils.isEnabled(FeatureFlags.SEARCH_V2)) {
|
||||||
|
intent = new Intent("com.android.settings.action.SETTINGS_SEARCH");
|
||||||
|
} else {
|
||||||
|
intent = new Intent(context, SearchActivity.class);
|
||||||
|
}
|
||||||
|
context.startActivity(intent);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.nullable;
|
import static org.mockito.ArgumentMatchers.nullable;
|
||||||
import static org.mockito.Matchers.anyInt;
|
import static org.mockito.Matchers.anyInt;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
@@ -29,13 +28,11 @@ import static org.mockito.Mockito.when;
|
|||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import android.app.FragmentManager;
|
import android.app.FragmentManager;
|
||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
import android.content.ComponentName;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import com.android.settings.search.SearchActivity;
|
|
||||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -46,7 +43,6 @@ import org.mockito.Mock;
|
|||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
import org.robolectric.RuntimeEnvironment;
|
import org.robolectric.RuntimeEnvironment;
|
||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
import org.robolectric.shadows.ShadowApplication;
|
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
||||||
@@ -97,15 +93,4 @@ public class SettingsActivityTest {
|
|||||||
|
|
||||||
assertThat((boolean) bundle.get(SettingsActivity.SAVE_KEY_SHOW_HOME_AS_UP)).isTrue();
|
assertThat((boolean) bundle.get(SettingsActivity.SAVE_KEY_SHOW_HOME_AS_UP)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testOnClick() {
|
|
||||||
doReturn("com.android.settings").when(mActivity).getPackageName();
|
|
||||||
|
|
||||||
mActivity.onClick(null);
|
|
||||||
|
|
||||||
Intent intent = ShadowApplication.getInstance().getNextStartedActivity();
|
|
||||||
assertThat(intent.getComponent()).isEqualTo(
|
|
||||||
new ComponentName("com.android.settings", SearchActivity.class.getName()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -31,9 +31,9 @@ import android.util.FeatureFlagUtils;
|
|||||||
|
|
||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.TestConfig;
|
||||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||||
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
|
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
|
||||||
import com.android.settings.TestConfig;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@@ -45,7 +45,7 @@ import org.robolectric.annotation.Config;
|
|||||||
import org.robolectric.util.ReflectionHelpers;
|
import org.robolectric.util.ReflectionHelpers;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
|
||||||
SettingsShadowSystemProperties.class
|
SettingsShadowSystemProperties.class
|
||||||
})
|
})
|
||||||
public class InstrumentedPreferenceFragmentTest {
|
public class InstrumentedPreferenceFragmentTest {
|
||||||
@@ -76,7 +76,7 @@ public class InstrumentedPreferenceFragmentTest {
|
|||||||
@Test
|
@Test
|
||||||
public void onCreatePreferences_noPreferenceScreenResId_shouldNotAddPreference() {
|
public void onCreatePreferences_noPreferenceScreenResId_shouldNotAddPreference() {
|
||||||
SettingsShadowSystemProperties.set(
|
SettingsShadowSystemProperties.set(
|
||||||
FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.USE_PREFERENCE_SCREEN_TITLE,
|
||||||
"true");
|
"true");
|
||||||
|
|
||||||
mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
|
mFragment.onCreatePreferences(Bundle.EMPTY, null /* rootKey */);
|
||||||
@@ -87,7 +87,7 @@ public class InstrumentedPreferenceFragmentTest {
|
|||||||
@Test
|
@Test
|
||||||
public void onCreatePreferences_gotPreferenceScreenResId_shouldAddPreferences() {
|
public void onCreatePreferences_gotPreferenceScreenResId_shouldAddPreferences() {
|
||||||
SettingsShadowSystemProperties.set(
|
SettingsShadowSystemProperties.set(
|
||||||
FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.USE_PREFERENCE_SCREEN_TITLE,
|
||||||
"true");
|
"true");
|
||||||
mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
|
mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
|
||||||
when(mFragment.getActivity()).thenReturn(mActivity);
|
when(mFragment.getActivity()).thenReturn(mActivity);
|
||||||
@@ -101,7 +101,7 @@ public class InstrumentedPreferenceFragmentTest {
|
|||||||
@Test
|
@Test
|
||||||
public void onCreatePreferences_gotPrefScreenResIdAndTitle_shouldAddPreferencesAndSetTitle() {
|
public void onCreatePreferences_gotPrefScreenResIdAndTitle_shouldAddPreferencesAndSetTitle() {
|
||||||
SettingsShadowSystemProperties.set(
|
SettingsShadowSystemProperties.set(
|
||||||
FeatureFlagUtils.FFLAG_PREFIX + mFragment.FEATURE_FLAG_USE_PREFERENCE_SCREEN_TITLE,
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.USE_PREFERENCE_SCREEN_TITLE,
|
||||||
"true");
|
"true");
|
||||||
mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
|
mFragment.setPreferenceScreenResId(R.xml.screen_pinning_settings);
|
||||||
when(mFragment.getActivity()).thenReturn(mActivity);
|
when(mFragment.getActivity()).thenReturn(mActivity);
|
||||||
@@ -114,14 +114,11 @@ public class InstrumentedPreferenceFragmentTest {
|
|||||||
verify(mActivity).setTitle(title);
|
verify(mActivity).setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class InstrumentedPreferenceFragmentTestable
|
public static class InstrumentedPreferenceFragmentTestable
|
||||||
extends InstrumentedPreferenceFragment {
|
extends InstrumentedPreferenceFragment {
|
||||||
|
|
||||||
private int mScreenId = -1;
|
private int mScreenId = -1;
|
||||||
|
|
||||||
public InstrumentedPreferenceFragmentTestable() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMetricsCategory() {
|
public int getMetricsCategory() {
|
||||||
return MetricsEvent.VIEW_UNKNOWN;
|
return MetricsEvent.VIEW_UNKNOWN;
|
||||||
|
@@ -42,6 +42,7 @@ import com.android.internal.logging.nano.MetricsProto;
|
|||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.settings.Settings.NightDisplaySuggestionActivity;
|
import com.android.settings.Settings.NightDisplaySuggestionActivity;
|
||||||
import com.android.settings.TestConfig;
|
import com.android.settings.TestConfig;
|
||||||
|
import com.android.settings.core.FeatureFlags;
|
||||||
import com.android.settings.testutils.FakeFeatureFactory;
|
import com.android.settings.testutils.FakeFeatureFactory;
|
||||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||||
import com.android.settings.testutils.shadow.SettingsShadowResources;
|
import com.android.settings.testutils.shadow.SettingsShadowResources;
|
||||||
@@ -67,7 +68,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION, shadows = {
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
|
||||||
ShadowSecureSettings.class,
|
ShadowSecureSettings.class,
|
||||||
SettingsShadowResources.class,
|
SettingsShadowResources.class,
|
||||||
SettingsShadowSystemProperties.class
|
SettingsShadowSystemProperties.class
|
||||||
@@ -136,7 +137,7 @@ public class SuggestionFeatureProviderImplTest {
|
|||||||
public void isSuggestionV2Enabled_isNotLowMemoryDevice_sysPropOn_shouldReturnTrue() {
|
public void isSuggestionV2Enabled_isNotLowMemoryDevice_sysPropOn_shouldReturnTrue() {
|
||||||
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
when(mActivityManager.isLowRamDevice()).thenReturn(false);
|
||||||
SettingsShadowSystemProperties.set(
|
SettingsShadowSystemProperties.set(
|
||||||
FeatureFlagUtils.FFLAG_PREFIX + mProvider.FEATURE_FLAG_SUGGESTIONS_V2, "true");
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.SUGGESTIONS_V2, "true");
|
||||||
assertThat(mProvider.isSuggestionV2Enabled(mContext)).isTrue();
|
assertThat(mProvider.isSuggestionV2Enabled(mContext)).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,13 +18,24 @@
|
|||||||
package com.android.settings.search;
|
package com.android.settings.search;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
import static org.mockito.ArgumentMatchers.eq;
|
||||||
|
import static org.mockito.Mockito.spy;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.robolectric.Shadows.shadowOf;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.FeatureFlagUtils;
|
||||||
|
import android.widget.Toolbar;
|
||||||
|
|
||||||
import com.android.settings.TestConfig;
|
import com.android.settings.TestConfig;
|
||||||
|
import com.android.settings.core.FeatureFlags;
|
||||||
import com.android.settings.dashboard.SiteMapManager;
|
import com.android.settings.dashboard.SiteMapManager;
|
||||||
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
import com.android.settings.testutils.SettingsRobolectricTestRunner;
|
||||||
|
import com.android.settings.testutils.shadow.SettingsShadowSystemProperties;
|
||||||
|
|
||||||
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -32,13 +43,12 @@ import org.mockito.MockitoAnnotations;
|
|||||||
import org.robolectric.Robolectric;
|
import org.robolectric.Robolectric;
|
||||||
import org.robolectric.annotation.Config;
|
import org.robolectric.annotation.Config;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.spy;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
@RunWith(SettingsRobolectricTestRunner.class)
|
@RunWith(SettingsRobolectricTestRunner.class)
|
||||||
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
|
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION_O, shadows = {
|
||||||
|
SettingsShadowSystemProperties.class
|
||||||
|
})
|
||||||
public class SearchFeatureProviderImplTest {
|
public class SearchFeatureProviderImplTest {
|
||||||
|
|
||||||
private SearchFeatureProviderImpl mProvider;
|
private SearchFeatureProviderImpl mProvider;
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
@@ -49,6 +59,11 @@ public class SearchFeatureProviderImplTest {
|
|||||||
mProvider = spy(new SearchFeatureProviderImpl());
|
mProvider = spy(new SearchFeatureProviderImpl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() {
|
||||||
|
SettingsShadowSystemProperties.clear();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void getSiteMapManager_shouldCacheInstance() {
|
public void getSiteMapManager_shouldCacheInstance() {
|
||||||
final SiteMapManager manager1 = mProvider.getSiteMapManager();
|
final SiteMapManager manager1 = mProvider.getSiteMapManager();
|
||||||
@@ -75,13 +90,51 @@ public class SearchFeatureProviderImplTest {
|
|||||||
verify(mProvider).cleanQuery(eq(query));
|
verify(mProvider).cleanQuery(eq(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void initSearchToolbar_searchV2_shouldInitWithOnClickListener() {
|
||||||
|
mProvider.initSearchToolbar(mActivity, null);
|
||||||
|
// Should not crash.
|
||||||
|
|
||||||
|
SettingsShadowSystemProperties.set(
|
||||||
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.SEARCH_V2,
|
||||||
|
"true");
|
||||||
|
final Toolbar toolbar = new Toolbar(mActivity);
|
||||||
|
mProvider.initSearchToolbar(mActivity, toolbar);
|
||||||
|
|
||||||
|
toolbar.performClick();
|
||||||
|
|
||||||
|
final Intent launchIntent = shadowOf(mActivity).getNextStartedActivity();
|
||||||
|
|
||||||
|
assertThat(launchIntent.getAction())
|
||||||
|
.isEqualTo("com.android.settings.action.SETTINGS_SEARCH");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void initSearchToolbar_searchV1_shouldInitWithOnClickListener() {
|
||||||
|
mProvider.initSearchToolbar(mActivity, null);
|
||||||
|
// Should not crash.
|
||||||
|
|
||||||
|
SettingsShadowSystemProperties.set(
|
||||||
|
FeatureFlagUtils.FFLAG_PREFIX + FeatureFlags.SEARCH_V2,
|
||||||
|
"false");
|
||||||
|
final Toolbar toolbar = new Toolbar(mActivity);
|
||||||
|
mProvider.initSearchToolbar(mActivity, toolbar);
|
||||||
|
|
||||||
|
toolbar.performClick();
|
||||||
|
|
||||||
|
final Intent launchIntent = shadowOf(mActivity).getNextStartedActivity();
|
||||||
|
|
||||||
|
assertThat(launchIntent.getComponent().getClassName())
|
||||||
|
.isEqualTo(SearchActivity.class.getName());
|
||||||
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
public void verifyLaunchSearchResultPageCaller_nullCaller_shouldCrash() {
|
public void verifyLaunchSearchResultPageCaller_nullCaller_shouldCrash() {
|
||||||
mProvider.verifyLaunchSearchResultPageCaller(mActivity, null /* caller */);
|
mProvider.verifyLaunchSearchResultPageCaller(mActivity, null /* caller */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = SecurityException.class)
|
@Test(expected = SecurityException.class)
|
||||||
public void everifyLaunchSearchResultPageCaller_badCaller_shouldCrash() {
|
public void verifyLaunchSearchResultPageCaller_badCaller_shouldCrash() {
|
||||||
final ComponentName cn = new ComponentName("pkg", "class");
|
final ComponentName cn = new ComponentName("pkg", "class");
|
||||||
mProvider.verifyLaunchSearchResultPageCaller(mActivity, cn);
|
mProvider.verifyLaunchSearchResultPageCaller(mActivity, cn);
|
||||||
}
|
}
|
||||||
|
@@ -17,105 +17,52 @@
|
|||||||
|
|
||||||
package com.android.settings.search;
|
package com.android.settings.search;
|
||||||
|
|
||||||
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import android.provider.SearchIndexablesContract;
|
import android.provider.SearchIndexablesContract;
|
||||||
import android.test.AndroidTestCase;
|
import android.support.test.filters.SmallTest;
|
||||||
import android.test.suitebuilder.annotation.SmallTest;
|
import android.support.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
public class SearchIndexablesContractTest extends AndroidTestCase {
|
@SmallTest
|
||||||
@SmallTest
|
@RunWith(AndroidJUnit4.class)
|
||||||
public void testRawColumns_IncludesRank() {
|
public class SearchIndexablesContractTest {
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_RANK,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
@Test
|
||||||
public void testRawColumns_IncludesTitle() {
|
public void testRawColumns_matchContractIndexing() {
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_TITLE,
|
assertThat(SearchIndexablesContract.RawData.COLUMN_RANK)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[1]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[0]);
|
||||||
}
|
assertThat(SearchIndexablesContract.RawData.COLUMN_TITLE)
|
||||||
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[1]);
|
||||||
@SmallTest
|
assertThat(SearchIndexablesContract.RawData.COLUMN_SUMMARY_ON)
|
||||||
public void testRawColumns_IncludesSummaryOn() {
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[2]);
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_SUMMARY_ON,
|
assertThat(SearchIndexablesContract.RawData.COLUMN_SUMMARY_OFF)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[2]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[3]);
|
||||||
}
|
assertThat(SearchIndexablesContract.RawData.COLUMN_ENTRIES)
|
||||||
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[4]);
|
||||||
@SmallTest
|
assertThat(SearchIndexablesContract.RawData.COLUMN_KEYWORDS)
|
||||||
public void testRawColumns_IncludesSummaryOff() {
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[5]);
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_SUMMARY_OFF,
|
assertThat(SearchIndexablesContract.RawData.COLUMN_SCREEN_TITLE)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[3]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[6]);
|
||||||
}
|
assertThat(SearchIndexablesContract.RawData.COLUMN_CLASS_NAME)
|
||||||
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[7]);
|
||||||
@SmallTest
|
assertThat(SearchIndexablesContract.RawData.COLUMN_ICON_RESID)
|
||||||
public void testRawColumns_IncludesEntries() {
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[8]);
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_ENTRIES,
|
assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_ACTION)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[4]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[9]);
|
||||||
}
|
assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_PACKAGE)
|
||||||
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[10]);
|
||||||
@SmallTest
|
assertThat(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_CLASS)
|
||||||
public void testRawColumns_IncludesKeywords() {
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[11]);
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_KEYWORDS,
|
assertThat(SearchIndexablesContract.RawData.COLUMN_KEY)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[5]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[12]);
|
||||||
}
|
assertThat(SearchIndexablesContract.RawData.COLUMN_USER_ID)
|
||||||
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[13]);
|
||||||
@SmallTest
|
assertThat(SearchIndexablesContract.RawData.PAYLOAD_TYPE)
|
||||||
public void testRawColumns_IncludesScreenTitle() {
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[14]);
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_SCREEN_TITLE,
|
assertThat(SearchIndexablesContract.RawData.PAYLOAD)
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[6]);
|
.isEqualTo(SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[15]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesClassName() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_CLASS_NAME,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesIcon() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_ICON_RESID,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[8]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesIntentAction() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_ACTION,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[9]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesIntentTargetPackage() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_PACKAGE,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[10]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesTargetClass() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_INTENT_TARGET_CLASS,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[11]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesKey() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_KEY,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[12]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesUserId() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.COLUMN_USER_ID,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[13]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesPayloadType() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.PAYLOAD_TYPE,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[14]);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SmallTest
|
|
||||||
public void testRawColumns_IncludesPayload() {
|
|
||||||
assertEquals(SearchIndexablesContract.RawData.PAYLOAD,
|
|
||||||
SearchIndexablesContract.INDEXABLES_RAW_COLUMNS[15]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user