<commit_before>package im.actor.sdk.receivers;

import im.actor.runtime.Log;
import im.actor.runtime.json.JSONObject;
import im.actor.sdk.ActorSDK;
import im.actor.sdk.push.ActorPushReceiver;

public class SDKPushReceiver extends ActorPushReceiver {

    @Override
    public void onPushReceived(String payload) {
        try {
            JSONObject object = new JSONObject(payload);
            if (object.has("data")) {
                JSONObject data = object.getJSONObject("data");
                if (data.has("seq")) {
                    int seq = data.getInt("seq");
                    Log.d("SDKPushReceiver", "Seq Received: " + seq);
                    ActorSDK.sharedActor().getMessenger().onPushReceived(seq);
                } else if (data.has("callId")) {
                    Long callId = Long.parseLong(data.getString("callId"));
                    int attempt = 0;
                    if (data.has("attemptIndex")) {
                        attempt = data.getInt("attemptIndex");
                    }
                    Log.d("SDKPushReceiver", "Received Call #" + callId + " (" + attempt + ")");
                    ActorSDK.sharedActor().getMessenger().checkCall(callId, attempt);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}<commit_msg>fix(android): SDKPushReceiver wait for messenger is ready<commit_after>package im.actor.sdk.receivers;

import im.actor.runtime.Log;
import im.actor.runtime.json.JSONObject;
import im.actor.sdk.ActorSDK;
import im.actor.sdk.push.ActorPushReceiver;

public class SDKPushReceiver extends ActorPushReceiver {

    @Override
    public void onPushReceived(String payload) {
        try {
            JSONObject object = new JSONObject(payload);
            if (object.has("data")) {
                JSONObject data = object.getJSONObject("data");
                ActorSDK.sharedActor().waitForReady();
                if (data.has("seq")) {
                    int seq = data.getInt("seq");
                    Log.d("SDKPushReceiver", "Seq Received: " + seq);
                    ActorSDK.sharedActor().getMessenger().onPushReceived(seq);
                } else if (data.has("callId")) {
                    Long callId = Long.parseLong(data.getString("callId"));
                    int attempt = 0;
                    if (data.has("attemptIndex")) {
                        attempt = data.getInt("attemptIndex");
                    }
                    Log.d("SDKPushReceiver", "Received Call #" + callId + " (" + attempt + ")");
                    ActorSDK.sharedActor().getMessenger().checkCall(callId, attempt);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
{'fraction_non_alphanumeric': 0.1244122965641953, 'fraction_numerical': 0.0007233273056057866, 'mean_word_length': 1.7771084337349397, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3233719', 'n_tokens_mistral': 759, 'n_tokens_neox': 703, 'n_words': 135}