mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-01-23 17:37:31 +01:00
Revert "Add default preferences for Huawei devices"
This reverts commit 4376d011ad112c970666bb2e9319292fd21cb650.
This commit is contained in:
parent
77d0d332b3
commit
16d499cb2a
@ -13,7 +13,6 @@ import androidx.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
|
||||
import org.microg.gms.common.PackageUtils;
|
||||
import org.microg.gms.gcm.McsConstants;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@ -44,7 +43,7 @@ public class CheckinPrefs implements SharedPreferences.OnSharedPreferenceChangeL
|
||||
systemDefaultPreferences = (SharedPreferences) Context.class.getDeclaredMethod("getSharedPreferences", File.class, int.class).invoke(context, new File("/system/etc/microg.xml"), Context.MODE_PRIVATE);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
update(context);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,13 +54,13 @@ public class CheckinPrefs implements SharedPreferences.OnSharedPreferenceChangeL
|
||||
return preferences.getBoolean(key, def);
|
||||
}
|
||||
|
||||
private void update(Context context) {
|
||||
checkinEnabled = getSettingsBoolean(PREF_ENABLE_CHECKIN, McsConstants.gmsExists(context));
|
||||
private void update() {
|
||||
checkinEnabled = getSettingsBoolean(PREF_ENABLE_CHECKIN, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
update(null);
|
||||
update();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
@ -19,7 +19,6 @@ package org.microg.gms.gcm;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.util.Log;
|
||||
@ -89,7 +88,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
systemDefaultPreferences = (SharedPreferences) Context.class.getDeclaredMethod("getSharedPreferences", File.class, int.class).invoke(context, new File("/system/etc/microg.xml"), Context.MODE_PRIVATE);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
update(context);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,8 +99,8 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
return preferences.getBoolean(key, def);
|
||||
}
|
||||
|
||||
public void update(Context context) {
|
||||
gcmEnabled = getSettingsBoolean(PREF_ENABLE_GCM, McsConstants.gmsExists(context));
|
||||
public void update() {
|
||||
gcmEnabled = getSettingsBoolean(PREF_ENABLE_GCM, true);
|
||||
gcmLogEnabled = getSettingsBoolean(PREF_FULL_LOG, true);
|
||||
confirmNewApps = getSettingsBoolean(PREF_CONFIRM_NEW_APPS, false);
|
||||
|
||||
@ -208,7 +207,7 @@ public class GcmPrefs implements SharedPreferences.OnSharedPreferenceChangeListe
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
||||
update(null);
|
||||
update();
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
|
@ -16,9 +16,6 @@
|
||||
|
||||
package org.microg.gms.gcm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
public final class McsConstants {
|
||||
public static final int MCS_HEARTBEAT_PING_TAG = 0;
|
||||
public static final int MCS_HEARTBEAT_ACK_TAG = 1;
|
||||
@ -47,15 +44,4 @@ public final class McsConstants {
|
||||
public static String ACTION_SEND = "org.microg.gms.gcm.mcs.SEND";
|
||||
public static String ACTION_ACK = "org.microg.gms.gcm.mcs.ACK";
|
||||
public static String EXTRA_REASON = "org.microg.gms.gcm.mcs.REASON";
|
||||
|
||||
public static boolean gmsExists(Context context) {
|
||||
try {
|
||||
if (context != null &&
|
||||
context.getPackageManager().getApplicationInfo("com.google.android.gms", 0).enabled) {
|
||||
return true;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user