wxr
2023-07-31 27cb19320ed4ac5552c17a263d0887a7cb88edc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.hdl.hdllinphonesdk.core.linphone;
 
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
 
import com.hdl.hdllinphonesdk.core.service.HDLLinphoneService;
import com.hdl.hdllinphonesdk.utils.HDLLog;
 
/**
 * KeepAliveHandler
 */
 
public class KeepAliveHandler extends BroadcastReceiver {
    private static final String TAG = "KeepAliveHandler";
    @Override
    public void onReceive(Context context, Intent intent) {
        if (HDLLinphoneService.isReady() && HDLLinphoneService.getCore() != null) {
            HDLLinphoneService.getCore().refreshRegisters();
//            SPUtils.save(context, "keepAlive", true);
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                HDLLog.e(TAG, "Cannot sleep for 2s");
            }
        }
    }
}