111
hxb
2022-11-24 0a3e07f10937484145f33c7560607b4b2353cb81
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.mm.android.deviceaddmodule.provider;
 
import com.company.NetSDK.INetSDK;
import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessException;
import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.BusinessRunnable;
import com.mm.android.deviceaddmodule.mobilecommon.AppConsume.IDeviceAdd;
import com.mm.android.deviceaddmodule.mobilecommon.base.BaseHandler;
import com.mm.android.deviceaddmodule.mobilecommon.businesstip.HandleMessageCode;
 
public class DeviceAddProvider implements IDeviceAdd {
 
    private volatile static DeviceAddProvider deviceAddProvider;
 
    public static DeviceAddProvider newInstance() {
        if (deviceAddProvider == null) {
            synchronized (DeviceAddProvider.class) {
                if (deviceAddProvider == null) {
                    deviceAddProvider = new DeviceAddProvider();
                }
            }
        }
        return deviceAddProvider;
    }
 
    @Override
    public void uninit() {
 
    }
 
    @Override
    public void stopSearchDevicesAsync(final long ret, final BaseHandler handler) {
        new BusinessRunnable(null) {
            @Override
            public void doBusiness() throws BusinessException {
                boolean result = INetSDK.StopSearchDevices(ret);
                if (handler != null)
                    handler.obtainMessage(HandleMessageCode.HMC_SUCCESS, result).sendToTarget();
            }
        };
    }
 
    @Override
    public boolean stopSearchDevices(long ret, String requestId) {
        boolean result = INetSDK.StopSearchDevices(ret);
        //搜索接口只报失败
        return result;
    }
}