Merge pull request #39 from Oizaro/master

Fix version name
This commit is contained in:
KevinX8 2020-09-01 23:44:21 +03:00 committed by GitHub
commit 6214c193d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 5 deletions

View File

@ -49,8 +49,8 @@ allprojects {
apply plugin: 'idea'
group = 'org.microg.gms'
version = "0.2.11.202414-vanced"
ext.appVersionCode = 202414022
version = "0.2.11.20500"
ext.appVersionCode = 202500022
ext.isReleaseVersion = false
}

View File

@ -45,7 +45,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
public static final String PREF_LEARNT_OTHER = "gcm_learnt_other";
private static final int MIN_INTERVAL = 1 * 60 * 1000; // 1 minute
private static final int MAX_INTERVAL = 3 * 60 * 1000; // 3 minutes
private static final int MAX_INTERVAL = 2 * 60 * 1000; // 2 minutes
private static GcmPrefs INSTANCE;

View File

@ -1,9 +1,15 @@
package org.microg.gms.ui;
import android.content.ComponentName;
import android.content.pm.PackageManager;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.navigation.fragment.NavHostFragment;
import androidx.preference.Preference;
import androidx.preference.SwitchPreferenceCompat;
import com.google.android.gms.cast.media.CastMediaRouteProviderService;
import com.mgoogle.android.gms.R;
@ -17,6 +23,7 @@ public class SettingsFragment extends ResourceSettingsFragment {
public static final String PREF_ABOUT = "pref_about";
public static final String PREF_GCM = "pref_gcm";
public static final String PREF_CHECKIN = "pref_checkin";
public static final String PREF_CAST_DOUBLE_FIX_ENABLED = "pref_cast_double_fix_enabled";
public SettingsFragment() {
preferencesResource = R.xml.preferences_start;
@ -40,6 +47,14 @@ public class SettingsFragment extends ResourceSettingsFragment {
UtilsKt.navigate(NavHostFragment.findNavController(SettingsFragment.this), getContext(), R.id.openAbout, null);
return true;
});
findPreference(PREF_CAST_DOUBLE_FIX_ENABLED).setOnPreferenceChangeListener((preference, newValue) -> {
boolean isEnabled = (boolean) newValue;
getContext().getPackageManager().setComponentEnabledSetting(
new ComponentName(getContext().getApplicationContext(), CastMediaRouteProviderService.class),
isEnabled ? PackageManager.COMPONENT_ENABLED_STATE_DISABLED : PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
return true;
});
if (GcmPrefs.get(getContext()).isEnabled()) {
GcmDatabase database = new GcmDatabase(getContext());
int regCount = database.getRegistrationList().size();

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorAccent"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11z"
android:fillColor="#000000"/>
</vector>

View File

@ -91,7 +91,7 @@ Questa operazione può richiedere alcuni minuti."</string>
<string name="pref_auth_visible_summary">Quando questa opzione è attiva, tutte le applicazioni su questo dispositivo saranno in grado di visualizzare gli indirizzi di posta elettronica dell\'account Google senza autorizzazione preventiva.</string>
<string name="pref_switcher_title">Registra dispositivo</string>
<string name="pref_checkin_enable_summary">Registra il tuo dispositivo ai servizi Google e crea un identificativo univoco. Vengono rimossi da microG alcuni bit funzionali all\'identificazione dai dati di registrazione, oltre al nome dell\'account Google.</string>
<string name="pref_checkin_enable_summary">Registra il tuo dispositivo ai servizi Google e crea un identificativo univoco. Vengono rimossi da microG alcuni bit funzionali all\'identificazione dei dati di registrazione, oltre al nome dell\'account Google.</string>
<string name="checkin_not_registered">Non registrato</string>
<string name="checkin_last_registration">Ultima registrazione: <xliff:g example="Yesterday, 02:20 PM">%1$s</xliff:g></string>
@ -107,6 +107,8 @@ Questa operazione può richiedere alcuni minuti."</string>
<string name="pref_gcm_confirm_new_apps_summary">Chiedi conferma all\'utente prima di registrare una nuova applicazione per le notifiche push.</string>
<string name="pref_about_title">A proposito di microG</string>
<string name="pref_cast_double_fix">Correzione Cast duplicato</string>
<string name="pref_cast_double_fix_summary">Attiva questa opzione in caso di voci duplicate nel menù di cast</string>
<string name="gcm_status_pref_auto">Automatico</string>
<string name="gcm_status_pref_manual">Manuale</string>

View File

@ -102,6 +102,7 @@ This can take a couple of minutes."</string>
<string name="pref_gcm_confirm_new_apps_summary">Ask before registering a new app to receive push notifications</string>
<string name="pref_about_title">About Vanced microG</string>
<string name="pref_cast_double_fix">Cast duplication fix</string>
<string name="pref_switcher_title">Register device</string>
<string name="pref_checkin_enable_summary">Registers your device to Google services and creates a unique device identifier. Vanced microG strips identifying bits other than your Google account name from registration data.</string>
@ -132,5 +133,5 @@ This can take a couple of minutes."</string>
<string name="prefcat_push_apps_registered_title">Registered apps</string>
<string name="prefcat_push_apps_unregistered_title">Unregistered apps</string>
<string name="prefcat_push_networks_title">Networks to use for push notifications</string>
<string name="pref_cast_double_fix_summary">Enable this if you see duplicates in your casting menu</string>
</resources>

View File

@ -42,6 +42,12 @@
android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity"
android:targetPackage="com.mgoogle.android.gms" />
</Preference>
<SwitchPreferenceCompat
android:key="pref_cast_double_fix_enabled"
android:title="@string/pref_cast_double_fix"
android:icon="@drawable/ic_cast_black"
android:summary="@string/pref_cast_double_fix_summary"
android:defaultValue="false"/>
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_category_no_label">
<Preference