Commit 0a0b2742 authored by Romain Hunault's avatar Romain Hunault

[OpenKeychain] Add OpenKeychain in Settings

parent 8774febd
Pipeline #3205 failed with stage
in 13 seconds
......@@ -3325,6 +3325,23 @@
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.MicroGSettings" />
</activity>
<activity android:name="Settings$OpenKeychainActivity"
android:label="@string/open_keychain"
android:icon="@drawable/ic_open_keychain">
<intent-filter android:priority="1">
<action android:name="android.settings.OPENKEYCHAIN_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="com.android.settings.action.SETTINGS" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.homepage" />
<meta-data android:name="com.android.settings.FRAGMENT_CLASS"
android:value="com.android.settings.OpenKeychainSettings" />
</activity>
<!-- This is the longest AndroidManifest.xml ever. -->
</application>
</manifest>
......@@ -9057,4 +9057,5 @@
<!-- /e/ specific changes -->
<string name="micro_g">MicroG</string>
<string name="open_keychain">OpenKeychain</string>
</resources>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/open_keychain">
<Preference>
<intent android:action="android.intent.action.MAIN"
android:targetPackage="org.sufficientlysecure.keychain"
android:targetClass="org.sufficientlysecure.keychain.ui.MainActivity" />
</Preference>
</PreferenceScreen>
package com.android.settings;
import android.os.Bundle;
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 OpenKeychainSettings extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = new Intent("android.intent.action.MAIN");
intent.setComponent(new ComponentName("org.sufficientlysecure.keychain", "org.sufficientlysecure.keychain.ui.MainActivity"));
startActivity(intent);
Activity activity = getActivity();
if (activity != null) {
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.open_keychain_prefs;
result.add(sir);
return result;
}
};
}
......@@ -172,6 +172,7 @@ public class Settings extends SettingsActivity {
public static class WifiAPITestActivity extends SettingsActivity { /* empty */ }
public static class WifiInfoActivity extends SettingsActivity { /* empty */ }
public static class MicroGActivity extends SettingsActivity { /* empty */ }
public static class OpenKeychainActivity extends SettingsActivity { /* empty */ }
public static class EnterprisePrivacySettingsActivity extends SettingsActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
......
......@@ -28,6 +28,7 @@ import com.android.settings.MasterClear;
import com.android.settings.PrivacySettings;
import com.android.settings.SecuritySettings;
import com.android.settings.MicroGSettings;
import com.android.settings.OpenKeychainSettings;
import com.android.settings.Settings;
import com.android.settings.TestingSettings;
import com.android.settings.TetherSettings;
......@@ -254,7 +255,8 @@ public class SettingsGateway {
LockscreenDashboardFragment.class.getName(),
BluetoothDeviceDetailsFragment.class.getName(),
DataUsageList.class.getName(),
MicroGSettings.class.getName()
MicroGSettings.class.getName(),
OpenKeychainSettings.class.getName()
};
......
......@@ -89,6 +89,7 @@ import com.android.settings.wifi.ConfigureWifiSettings;
import com.android.settings.wifi.SavedAccessPointsWifiSettings;
import com.android.settings.wifi.WifiSettings;
import com.android.settings.MicroGSettings;
import com.android.settings.OpenKeychainSettings;
import java.util.Collection;
import java.util.HashMap;
......@@ -218,6 +219,7 @@ public final class SearchIndexableResources {
NO_DATA_RES_ID,
R.drawable.ic_settings_storage);
addIndex(MicroGSettings.class, R.xml.micro_g_prefs, R.drawable.ic_microg_settings);
addIndex(OpenKeychainSettings.class, R.xml.open_keychain_prefs, R.drawable.ic_open_keychain);
}
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