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

Commit 3b5e6449 authored by Abhishek Aggarwal's avatar Abhishek Aggarwal Committed by Nishith Khanna
Browse files

LineageParts: Add openkeychain

parent 121eb11f
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -210,6 +210,27 @@
                android:resource="@string/summary_empty" />
        </activity-alias>

        <!-- OpenKeychain settings (Security category) -->
        <activity-alias
            android:name=".openkeychain.OpenKeychainSettings"
            android:label="@string/openkeychain_title"
            android:targetActivity="PartsActivity">
            <intent-filter>
                <action android:name="com.android.settings.action.IA_SETTINGS" />
                <action android:name="org.lineageos.lineageparts.OPENKEYCHAIN_SETTINGS" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
            <meta-data
                android:name="com.android.settings.category"
                android:value="com.android.settings.category.ia.security" />
            <meta-data
                android:name="com.android.settings.order"
                android:value="75" />
            <meta-data
                android:name="com.android.settings.summary"
                android:resource="@string/summary_empty" />
        </activity-alias>

        <!-- Trust interface (Privacy category) -->
        <activity-alias
            android:name=".trust.TrustPreferences"
+3 −0
Original line number Diff line number Diff line
@@ -704,4 +704,7 @@

    <!-- MicroG -->
    <string name="microg_title">MicroG</string>

    <!-- OpenKeyChain -->
    <string name="openkeychain_title">OpenKeychain</string>
</resources>
+18 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2022 /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
          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"
    android:key="openkeychain_settings"
    android:title="@string/openkeychain_title" />
+5 −0
Original line number Diff line number Diff line
@@ -111,4 +111,9 @@
          android:title="@string/microg_title"
          android:fragment="org.lineageos.lineageparts.microg.MicrogSettings"
          lineage:xmlRes="@xml/microg_settings" />

    <part android:key="openkeychain_Settings"
          android:title="@string/openkeychain_title"
          android:fragment="org.lineageos.lineageparts.openkeychain.OpenKeychainSettings"
          lineage:xmlRes="@xml/openkeychain_settings" />
</parts-catalog>
+45 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 /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
 *
 *      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 org.lineageos.lineageparts.openkeychain;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;

import org.lineageos.lineageparts.R;
import org.lineageos.lineageparts.SettingsPreferenceFragment;

public class OpenKeychainSettings extends SettingsPreferenceFragment {

    private static final String OPENKEYCHAIN_PACKAGE_NAME = "org.sufficientlysecure.keychain";
    private static final String OPENKEYCHAIN_ACTIVITY_NAME = "org.sufficientlysecure.keychain.ui.MainActivity";

    @Override
    public void onCreate(Bundle savedInstance) {
        super.onCreate(savedInstance);

        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.setComponent(new ComponentName(OPENKEYCHAIN_PACKAGE_NAME, OPENKEYCHAIN_ACTIVITY_NAME));
        startActivity(intent);

	Activity activity = getActivity();
        if (activity != null) {
          activity.finish();
        }
    }
}