mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-12-24 03:35:50 +01:00
updated checkin
This commit is contained in:
parent
75a93f052e
commit
9b7680f915
0
play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java
Normal file → Executable file
0
play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java
Normal file → Executable file
4
play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java
Normal file → Executable file
4
play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java
Normal file → Executable file
@ -33,8 +33,6 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.microg.gms.checkin.TriggerReceiver.PREF_ENABLE_CHECKIN;
|
||||
|
||||
public class CheckinManager {
|
||||
private static final long MIN_CHECKIN_INTERVAL = 3 * 60 * 60 * 1000; // 3 hours
|
||||
|
||||
@ -43,7 +41,7 @@ public class CheckinManager {
|
||||
LastCheckinInfo info = LastCheckinInfo.read(context);
|
||||
if (!force && info.lastCheckin > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL)
|
||||
return null;
|
||||
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean(PREF_ENABLE_CHECKIN, true))
|
||||
if (!CheckinPrefs.get(context).isEnabled())
|
||||
return null;
|
||||
List<CheckinClient.Account> accounts = new ArrayList<CheckinClient.Account>();
|
||||
AccountManager accountManager = AccountManager.get(context);
|
||||
|
0
play-services-core/src/main/java/org/microg/gms/checkin/CheckinPrefs.java
Normal file → Executable file
0
play-services-core/src/main/java/org/microg/gms/checkin/CheckinPrefs.java
Normal file → Executable file
4
play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java
Normal file → Executable file
4
play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java
Normal file → Executable file
@ -34,8 +34,6 @@ import org.microg.gms.common.ForegroundServiceContext;
|
||||
import org.microg.gms.gcm.McsService;
|
||||
import org.microg.gms.people.PeopleManager;
|
||||
|
||||
import static org.microg.gms.checkin.TriggerReceiver.PREF_ENABLE_CHECKIN;
|
||||
|
||||
public class CheckinService extends IntentService {
|
||||
private static final String TAG = "GmsCheckinSvc";
|
||||
public static final String BIND_ACTION = "com.google.android.gms.checkin.BIND_TO_SERVICE";
|
||||
@ -58,7 +56,7 @@ public class CheckinService extends IntentService {
|
||||
protected void onHandleIntent(Intent intent) {
|
||||
try {
|
||||
ForegroundServiceContext.completeForegroundService(this, intent, TAG);
|
||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PREF_ENABLE_CHECKIN, true)) {
|
||||
if (CheckinPrefs.get(this).isEnabled()) {
|
||||
LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false));
|
||||
if (info != null) {
|
||||
Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId));
|
||||
|
0
play-services-core/src/main/java/org/microg/gms/checkin/LastCheckinInfo.java
Normal file → Executable file
0
play-services-core/src/main/java/org/microg/gms/checkin/LastCheckinInfo.java
Normal file → Executable file
0
play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java
Normal file → Executable file
0
play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java
Normal file → Executable file
Loading…
Reference in New Issue
Block a user