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

Commit 0eb0591d authored by Romain Hunault's avatar Romain Hunault
Browse files

Create menu for microG (instead of submenu)

parent 11320c93
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -3332,8 +3332,6 @@
            </intent-filter>
            <meta-data android:name="com.android.settings.category"
                android:value="com.android.settings.category.system" />
            <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
                android:value="com.android.settings.MicroGSettings" />
        </activity>
    </application>
</manifest>

res/xml/micro_g_prefs.xml

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
<?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:title="@string/micro_g">

    <Preference android:title="@string/micro_g_title" >
        <intent android:action="android.intent.action.MAIN"
            android:targetPackage="com.google.android.gms"
            android:targetClass="org.microg.gms.ui.SettingsActivity" />
    </Preference>

</PreferenceScreen>
+0 −34
Original line number Diff line number Diff line
/*
 * 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.
 */

package com.android.settings;

import android.os.Bundle;

public class MicroGSettings extends SettingsPreferenceFragment {

    @Override
    protected int getMetricsCategory() {
        return com.android.settings.InstrumentedFragment.UNDECLARED;
    }

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

        addPreferencesFromResource(R.xml.micro_g_prefs);
    }
}
+14 −0
Original line number Diff line number Diff line
@@ -22,6 +22,10 @@ import com.android.settings.applications.AppOpsSummary;
import com.android.settings.enterprise.EnterprisePrivacySettings;
import com.android.settings.fingerprint.FingerprintEnrollIntroduction;
import com.android.settings.password.ChooseLockGeneric;
import com.android.settings.fingerprint.FingerprintSettings;
import android.content.Intent;
import android.content.ComponentName;
import android.os.Bundle;

/**
 * Top-level Settings activity
@@ -191,5 +195,15 @@ public class Settings extends SettingsActivity {
    public static class UserAndAccountDashboardActivity extends SettingsActivity {}
    public static class SystemDashboardActivity extends SettingsActivity {}
    public static class MicroGActivity extends SettingsActivity { /* empty */ }
        public static class MicroGActivity extends SettingsActivity {
            @Override
            protected void onCreate(Bundle savedState) {
                super.onCreate(savedState);

                Intent intent = new Intent("android.intent.action.MAIN");
                intent.setComponent(new ComponentName("com.google.android.gms", "org.microg.gms.ui.SettingsActivity"));
                startActivity(intent);
            }
        }

}