Commit 37eb6f45 authored by Romain Hunault's avatar Romain Hunault

Index MicroG for search feature

parent 97b7e38a
......@@ -3260,5 +3260,4 @@
<string name="carrier_provisioning" msgid="4398683675591893169">"Informations de gestion des comptes opérateur"</string>
<string name="trigger_carrier_provisioning" msgid="3434865918009286187">"Déclencher la gestion des comptes opérateur"</string>
<string name="micro_g">"MicroG"</string>
<string name="micro_g_title">"Accéder aux paramètres microG"</string>
</resources>
......@@ -7961,7 +7961,6 @@
<string name="touchscreen_gesture_settings_summary">Perform various touchscreen gestures for quick actions</string>
<string name="micro_g">MicroG</string>
<string name="micro_g_title">Access to MicroG settings</string>
<string name="e_contributors_title">/e/ contributors</string>
<string name="lineageos_contributors_title">LineageOS contributors</string>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<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>
<intent android:action="android.intent.action.MAIN"
android:targetPackage="com.google.android.gms"
android:targetClass="org.microg.gms.ui.SettingsActivity" />
</Preference>
</PreferenceScreen>
......@@ -22,6 +22,15 @@ import android.content.ComponentName;
import android.app.Fragment;
import android.app.Activity;
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
......@@ -38,4 +47,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;
}
};
}
......@@ -55,6 +55,7 @@ import com.android.settings.users.UserSettings;
import com.android.settings.wifi.AdvancedWifiSettings;
import com.android.settings.wifi.SavedAccessPointsWifiSettings;
import com.android.settings.wifi.WifiSettings;
import com.android.settings.MicroGSettings;
import java.util.HashMap;
......@@ -87,6 +88,7 @@ public final class Ranking {
public static final int RANK_DEVELOPEMENT = 22;
public static final int RANK_DEVICE_INFO = 23;
public static final int RANK_GESTURE = 24;
public static final int RANK_MICROG = 25;
public static final int RANK_UNDEFINED = -1;
public static final int RANK_OTHERS = 1024;
......@@ -185,6 +187,9 @@ public final class Ranking {
sRankMap.put(DeviceInfoSettings.class.getName(), RANK_DEVICE_INFO);
sRankMap.put(LegalSettings.class.getName(), RANK_DEVICE_INFO);
// MicroG
sRankMap.put(MicroGSettings.class.getName(), RANK_MICROG);
sBaseRankMap.put("com.android.settings", 0);
}
......
......@@ -55,6 +55,7 @@ import com.android.settings.users.UserSettings;
import com.android.settings.wifi.AdvancedWifiSettings;
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;
......@@ -326,6 +327,13 @@ public final class SearchIndexableResources {
R.xml.zen_mode_visual_interruptions_settings,
ZenModeVisualInterruptionSettings.class.getName(),
R.drawable.ic_settings_notifications));
sResMap.put(MicroGSettings.class.getName(),
new SearchIndexableResource(
Ranking.getRankForClassName(MicroGSettings.class.getName()),
R.xml.micro_g_prefs,
MicroGSettings.class.getName(),
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