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

Commit 6571548a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Provider Model] Fix the NetworkDashboardFragmentTest failed issue"

parents c3d81865 66869d2f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.util.Log;

import androidx.appcompat.app.AlertDialog;
@@ -38,6 +39,7 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@SearchIndexable
@@ -185,6 +187,18 @@ public class NetworkDashboardFragment extends DashboardFragment implements
    public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
            new BaseSearchIndexProvider(R.xml.network_and_internet) {

                @Override
                // TODO(b/167474581): Should remove this method when Provider Model finished.
                public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
                        boolean enabled) {
                    if (Utils.isProviderModelEnabled(context)) {
                        final SearchIndexableResource sir = new SearchIndexableResource(context);
                        sir.xmlResId = R.xml.network_provider_internet;
                        return Arrays.asList(sir);
                    }
                    return super.getXmlResourcesToIndex(context, enabled);
                }

                @Override
                public List<AbstractPreferenceController> createPreferenceControllers(Context
                        context) {