Loading UnifiedNlp @ 6942a05d Compare bcf1cff3 to 6942a05d Original line number Original line Diff line number Diff line Subproject commit bcf1cff35ef8c111c8c0570ccb803ec3edd44eed Subproject commit 6942a05db781aa1f2e71eadbe4cbb07b6c4f8a5c play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,8 @@ import org.microg.gms.people.PeopleManager; public class CheckinService extends IntentService { public class CheckinService extends IntentService { private static final String TAG = "GmsCheckinSvc"; private static final String TAG = "GmsCheckinSvc"; public static final String BIND_ACTION = "com.google.android.gms.checkin.BIND_TO_SERVICE"; public static final String BIND_ACTION = "com.google.android.gms.checkin.BIND_TO_SERVICE"; public static final String EXTRA_FORCE_CHECKIN = "force"; public static final String EXTRA_CALLBACK_INTENT = "callback"; private ICheckinService iface = new ICheckinService.Stub() { private ICheckinService iface = new ICheckinService.Stub() { @Override @Override Loading @@ -49,7 +51,7 @@ public class CheckinService extends IntentService { @Override @Override protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) { try { try { LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra("force", false)); LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false)); if (info != null) { if (info != null) { Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId)); Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId)); String accountType = getString(R.string.google_account_type); String accountType = getString(R.string.google_account_type); Loading @@ -57,6 +59,9 @@ public class CheckinService extends IntentService { PeopleManager.loadUserInfo(this, account); PeopleManager.loadUserInfo(this, account); } } McsService.scheduleReconnect(this); McsService.scheduleReconnect(this); if (intent.hasExtra(EXTRA_CALLBACK_INTENT)) { startService((Intent) intent.getParcelableExtra(EXTRA_CALLBACK_INTENT)); } } } } catch (Exception e) { } catch (Exception e) { Log.w(TAG, e); Log.w(TAG, e); Loading play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class TriggerReceiver extends WakefulBroadcastReceiver { NetworkInfo networkInfo = cm.getActiveNetworkInfo(); NetworkInfo networkInfo = cm.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected() || force) { if (networkInfo != null && networkInfo.isConnected() || force) { Intent subIntent = new Intent(context, CheckinService.class); Intent subIntent = new Intent(context, CheckinService.class); subIntent.putExtra("force", force); subIntent.putExtra(CheckinService.EXTRA_FORCE_CHECKIN, force); startWakefulService(context, subIntent); startWakefulService(context, subIntent); } } } else { } else { Loading play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterService.java +21 −8 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Message; import android.os.Messenger; import android.os.Messenger; import android.util.Log; import android.util.Log; import org.microg.gms.checkin.CheckinService; import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.common.PackageUtils; import org.microg.gms.common.PackageUtils; import org.microg.gms.common.Utils; import org.microg.gms.common.Utils; Loading @@ -37,6 +38,7 @@ import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_UNREGISTER; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_UNREGISTER; import static org.microg.gms.gcm.GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; import static org.microg.gms.gcm.GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; import static org.microg.gms.gcm.GcmConstants.EXTRA_DELETE; import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; Loading @@ -51,6 +53,8 @@ public class PushRegisterService extends IntentService { private static final String ERROR = "%%ERROR%%"; private static final String ERROR = "%%ERROR%%"; private static final String GCM_REGISTRATION_PREF = "gcm_registrations"; private static final String GCM_REGISTRATION_PREF = "gcm_registrations"; private static final String EXTRA_SKIP_TRY_CHECKIN = "skip_checkin"; public PushRegisterService() { public PushRegisterService() { super(TAG); super(TAG); setIntentRedelivery(false); setIntentRedelivery(false); Loading @@ -63,9 +67,10 @@ public class PushRegisterService extends IntentService { @Override @Override protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) { Log.d(TAG, "onHandleIntent: " + intent); Log.d(TAG, "onHandleIntent: " + intent); if (LastCheckinInfo.read(this).lastCheckin > 0) { try { try { if (ACTION_C2DM_UNREGISTER.equals(intent.getAction()) || if (ACTION_C2DM_UNREGISTER.equals(intent.getAction()) || (ACTION_C2DM_REGISTER.equals(intent.getAction()) && "1".equals(intent.getStringExtra("delete")))) { (ACTION_C2DM_REGISTER.equals(intent.getAction()) && "1".equals(intent.getStringExtra(EXTRA_DELETE)))) { unregister(intent); unregister(intent); } else if (ACTION_C2DM_REGISTER.equals(intent.getAction())) { } else if (ACTION_C2DM_REGISTER.equals(intent.getAction())) { register(intent); register(intent); Loading @@ -73,6 +78,14 @@ public class PushRegisterService extends IntentService { } catch (Exception e) { } catch (Exception e) { Log.w(TAG, e); Log.w(TAG, e); } } } else if (!intent.getBooleanExtra(EXTRA_SKIP_TRY_CHECKIN, false)) { Log.d(TAG, "No checkin yet, trying to checkin"); intent.putExtra(EXTRA_SKIP_TRY_CHECKIN, true); Intent subIntent = new Intent(this, CheckinService.class); subIntent.putExtra(CheckinService.EXTRA_FORCE_CHECKIN, true); subIntent.putExtra(CheckinService.EXTRA_CALLBACK_INTENT, intent); startService(subIntent); } } } @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") Loading Loading
UnifiedNlp @ 6942a05d Compare bcf1cff3 to 6942a05d Original line number Original line Diff line number Diff line Subproject commit bcf1cff35ef8c111c8c0570ccb803ec3edd44eed Subproject commit 6942a05db781aa1f2e71eadbe4cbb07b6c4f8a5c
play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java +6 −1 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,8 @@ import org.microg.gms.people.PeopleManager; public class CheckinService extends IntentService { public class CheckinService extends IntentService { private static final String TAG = "GmsCheckinSvc"; private static final String TAG = "GmsCheckinSvc"; public static final String BIND_ACTION = "com.google.android.gms.checkin.BIND_TO_SERVICE"; public static final String BIND_ACTION = "com.google.android.gms.checkin.BIND_TO_SERVICE"; public static final String EXTRA_FORCE_CHECKIN = "force"; public static final String EXTRA_CALLBACK_INTENT = "callback"; private ICheckinService iface = new ICheckinService.Stub() { private ICheckinService iface = new ICheckinService.Stub() { @Override @Override Loading @@ -49,7 +51,7 @@ public class CheckinService extends IntentService { @Override @Override protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) { try { try { LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra("force", false)); LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false)); if (info != null) { if (info != null) { Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId)); Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId)); String accountType = getString(R.string.google_account_type); String accountType = getString(R.string.google_account_type); Loading @@ -57,6 +59,9 @@ public class CheckinService extends IntentService { PeopleManager.loadUserInfo(this, account); PeopleManager.loadUserInfo(this, account); } } McsService.scheduleReconnect(this); McsService.scheduleReconnect(this); if (intent.hasExtra(EXTRA_CALLBACK_INTENT)) { startService((Intent) intent.getParcelableExtra(EXTRA_CALLBACK_INTENT)); } } } } catch (Exception e) { } catch (Exception e) { Log.w(TAG, e); Log.w(TAG, e); Loading
play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -43,7 +43,7 @@ public class TriggerReceiver extends WakefulBroadcastReceiver { NetworkInfo networkInfo = cm.getActiveNetworkInfo(); NetworkInfo networkInfo = cm.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected() || force) { if (networkInfo != null && networkInfo.isConnected() || force) { Intent subIntent = new Intent(context, CheckinService.class); Intent subIntent = new Intent(context, CheckinService.class); subIntent.putExtra("force", force); subIntent.putExtra(CheckinService.EXTRA_FORCE_CHECKIN, force); startWakefulService(context, subIntent); startWakefulService(context, subIntent); } } } else { } else { Loading
play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterService.java +21 −8 Original line number Original line Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.Message; import android.os.Messenger; import android.os.Messenger; import android.util.Log; import android.util.Log; import org.microg.gms.checkin.CheckinService; import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.common.PackageUtils; import org.microg.gms.common.PackageUtils; import org.microg.gms.common.Utils; import org.microg.gms.common.Utils; Loading @@ -37,6 +38,7 @@ import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_UNREGISTER; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_UNREGISTER; import static org.microg.gms.gcm.GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; import static org.microg.gms.gcm.GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; import static org.microg.gms.gcm.GcmConstants.EXTRA_DELETE; import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; Loading @@ -51,6 +53,8 @@ public class PushRegisterService extends IntentService { private static final String ERROR = "%%ERROR%%"; private static final String ERROR = "%%ERROR%%"; private static final String GCM_REGISTRATION_PREF = "gcm_registrations"; private static final String GCM_REGISTRATION_PREF = "gcm_registrations"; private static final String EXTRA_SKIP_TRY_CHECKIN = "skip_checkin"; public PushRegisterService() { public PushRegisterService() { super(TAG); super(TAG); setIntentRedelivery(false); setIntentRedelivery(false); Loading @@ -63,9 +67,10 @@ public class PushRegisterService extends IntentService { @Override @Override protected void onHandleIntent(Intent intent) { protected void onHandleIntent(Intent intent) { Log.d(TAG, "onHandleIntent: " + intent); Log.d(TAG, "onHandleIntent: " + intent); if (LastCheckinInfo.read(this).lastCheckin > 0) { try { try { if (ACTION_C2DM_UNREGISTER.equals(intent.getAction()) || if (ACTION_C2DM_UNREGISTER.equals(intent.getAction()) || (ACTION_C2DM_REGISTER.equals(intent.getAction()) && "1".equals(intent.getStringExtra("delete")))) { (ACTION_C2DM_REGISTER.equals(intent.getAction()) && "1".equals(intent.getStringExtra(EXTRA_DELETE)))) { unregister(intent); unregister(intent); } else if (ACTION_C2DM_REGISTER.equals(intent.getAction())) { } else if (ACTION_C2DM_REGISTER.equals(intent.getAction())) { register(intent); register(intent); Loading @@ -73,6 +78,14 @@ public class PushRegisterService extends IntentService { } catch (Exception e) { } catch (Exception e) { Log.w(TAG, e); Log.w(TAG, e); } } } else if (!intent.getBooleanExtra(EXTRA_SKIP_TRY_CHECKIN, false)) { Log.d(TAG, "No checkin yet, trying to checkin"); intent.putExtra(EXTRA_SKIP_TRY_CHECKIN, true); Intent subIntent = new Intent(this, CheckinService.class); subIntent.putExtra(CheckinService.EXTRA_FORCE_CHECKIN, true); subIntent.putExtra(CheckinService.EXTRA_CALLBACK_INTENT, intent); startService(subIntent); } } } @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") Loading