Do a check-in if we are not actually checked in, but should be, e.g. cleared app data

Change-Id: If800339fa35644d8783203fbd511128457d6d101
This commit is contained in:
Torsten Grote 2021-06-04 11:16:58 -03:00 committed by Marvin W
parent f806e1bcdb
commit 14d666a163

View File

@ -25,6 +25,7 @@ import android.util.Log;
import androidx.legacy.content.WakefulBroadcastReceiver;
import org.microg.gms.checkin.CheckinPrefs;
import org.microg.gms.checkin.LastCheckinInfo;
import org.microg.gms.common.ForegroundServiceContext;
@ -67,6 +68,14 @@ public class TriggerReceiver extends WakefulBroadcastReceiver {
if (LastCheckinInfo.read(context).getAndroidId() == 0) {
Log.d(TAG, "Ignoring " + intent + ": need to checkin first.");
if (CheckinPrefs.isEnabled(context)) {
// Do a check-in if we are not actually checked in,
// but should be, e.g. cleared app data
Log.d(TAG, "Requesting check-in...");
String action = "android.server.checkin.CHECKIN";
Class<?> clazz = org.microg.gms.checkin.TriggerReceiver.class;
context.sendBroadcast(new Intent(action, null, context, clazz));
}
return;
}