Commit dc96bdb5 authored by Romain Hunault's avatar Romain Hunault

Index MicroG for search feature

parent 51ee0919
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Copyright (C) 2018 e.foundation
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
......@@ -3725,5 +3725,4 @@
<!-- /e/ specific changes -->
<string name="micro_g">"MicroG"</string>
<string name="micro_g_title">"Accéder aux paramètres microG"</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Copyright (C) 2018 e.foundation
Copyright (C) 2018 e.foundation
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
......@@ -9057,5 +9057,4 @@
<!-- /e/ specific changes -->
<string name="micro_g">MicroG</string>
<string name="micro_g_title">Access to MicroG settings</string>
</resources>
......@@ -16,13 +16,13 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:key="microg_settings"
android:title="@string/micro_g">
<Preference android:title="@string/micro_g_title" >
<Preference>
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.google.android.gms"
android:targetClass="org.microg.gms.ui.SettingsActivity" />
</Preference>
</PreferenceScreen>
......@@ -21,6 +21,15 @@ import android.content.Intent;
import android.content.ComponentName;
import android.app.Fragment;
import android.app.Activity;
import android.content.Context;
import android.provider.SearchIndexableResource;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import java.util.ArrayList;
import java.util.List;
public class MicroGSettings extends Fragment {
@Override
......@@ -37,4 +46,18 @@ public class MicroGSettings extends Fragment {
activity.finish();
}
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider() {
@Override
public List<SearchIndexableResource> getXmlResourcesToIndex(Context context,
boolean enabled) {
final ArrayList<SearchIndexableResource> result = new ArrayList<>();
final SearchIndexableResource sir = new SearchIndexableResource(context);
sir.xmlResId = R.xml.micro_g_prefs;
result.add(sir);
return result;
}
};
}
......@@ -88,6 +88,7 @@ import com.android.settings.wallpaper.WallpaperTypeSettings;
import com.android.settings.wifi.ConfigureWifiSettings;
import com.android.settings.wifi.SavedAccessPointsWifiSettings;
import com.android.settings.wifi.WifiSettings;
import com.android.settings.MicroGSettings;
import java.util.Collection;
import java.util.HashMap;
......@@ -216,6 +217,7 @@ public final class SearchIndexableResources {
AutomaticStorageManagerSettings.class,
NO_DATA_RES_ID,
R.drawable.ic_settings_storage);
addIndex(MicroGSettings.class, R.xml.micro_g_prefs, R.drawable.ic_microg_settings);
}
private SearchIndexableResources() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment