mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-10 13:05:05 +00:00
commit
6214c193d0
7 changed files with 39 additions and 5 deletions
|
@ -49,8 +49,8 @@ allprojects {
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
|
|
||||||
group = 'org.microg.gms'
|
group = 'org.microg.gms'
|
||||||
version = "0.2.11.202414-vanced"
|
version = "0.2.11.20500"
|
||||||
ext.appVersionCode = 202414022
|
ext.appVersionCode = 202500022
|
||||||
ext.isReleaseVersion = false
|
ext.isReleaseVersion = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||||
public static final String PREF_LEARNT_OTHER = "gcm_learnt_other";
|
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 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;
|
private static GcmPrefs INSTANCE;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,15 @@
|
||||||
package org.microg.gms.ui;
|
package org.microg.gms.ui;
|
||||||
|
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.navigation.fragment.NavHostFragment;
|
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;
|
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_ABOUT = "pref_about";
|
||||||
public static final String PREF_GCM = "pref_gcm";
|
public static final String PREF_GCM = "pref_gcm";
|
||||||
public static final String PREF_CHECKIN = "pref_checkin";
|
public static final String PREF_CHECKIN = "pref_checkin";
|
||||||
|
public static final String PREF_CAST_DOUBLE_FIX_ENABLED = "pref_cast_double_fix_enabled";
|
||||||
|
|
||||||
public SettingsFragment() {
|
public SettingsFragment() {
|
||||||
preferencesResource = R.xml.preferences_start;
|
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);
|
UtilsKt.navigate(NavHostFragment.findNavController(SettingsFragment.this), getContext(), R.id.openAbout, null);
|
||||||
return true;
|
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()) {
|
if (GcmPrefs.get(getContext()).isEnabled()) {
|
||||||
GcmDatabase database = new GcmDatabase(getContext());
|
GcmDatabase database = new GcmDatabase(getContext());
|
||||||
int regCount = database.getRegistrationList().size();
|
int regCount = database.getRegistrationList().size();
|
||||||
|
|
10
play-services-core/src/main/res/drawable/ic_cast_black.xml
Normal file
10
play-services-core/src/main/res/drawable/ic_cast_black.xml
Normal 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>
|
|
@ -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_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_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_not_registered">Non registrato</string>
|
||||||
<string name="checkin_last_registration">Ultima registrazione: <xliff:g example="Yesterday, 02:20 PM">%1$s</xliff:g></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_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_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_auto">Automatico</string>
|
||||||
<string name="gcm_status_pref_manual">Manuale</string>
|
<string name="gcm_status_pref_manual">Manuale</string>
|
||||||
|
|
|
@ -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_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_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_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>
|
<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_registered_title">Registered apps</string>
|
||||||
<string name="prefcat_push_apps_unregistered_title">Unregistered 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="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>
|
</resources>
|
||||||
|
|
|
@ -42,6 +42,12 @@
|
||||||
android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity"
|
android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity"
|
||||||
android:targetPackage="com.mgoogle.android.gms" />
|
android:targetPackage="com.mgoogle.android.gms" />
|
||||||
</Preference>
|
</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>
|
||||||
<PreferenceCategory android:layout="@layout/preference_category_no_label">
|
<PreferenceCategory android:layout="@layout/preference_category_no_label">
|
||||||
<Preference
|
<Preference
|
||||||
|
|
Loading…
Reference in a new issue