This commit is contained in:
parent
a9ed698358
commit
4cccd1ddad
|
|
@ -62,6 +62,7 @@ import com.igexin.sdk.PushManager;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||||
|
import com.xiaomi.mipush.sdk.MiPushClient;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -382,6 +383,11 @@ public class LoadingActivity extends BaseActivityNotAnim {
|
||||||
// IIntentService
|
// IIntentService
|
||||||
PushManager.getInstance().preInit(this);
|
PushManager.getInstance().preInit(this);
|
||||||
PushManager.getInstance().initialize(this);
|
PushManager.getInstance().initialize(this);
|
||||||
|
MiPushClient.setAlias(this,"aaa","aaa" );
|
||||||
|
|
||||||
|
L.i("jjia------push init-as-"+MiPushClient.getAllAlias(this));
|
||||||
|
L.i("jjia------push init-getRegId-"+MiPushClient.getRegId(this));
|
||||||
|
L.i("jjia------push init-getRegId-"+PushManager.getInstance().getClientid(this));
|
||||||
if (BuildConfig.DEBUG){
|
if (BuildConfig.DEBUG){
|
||||||
PushManager.getInstance().setDebugLogger(this, s -> L.i("jjia--------"+s));
|
PushManager.getInstance().setDebugLogger(this, s -> L.i("jjia--------"+s));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1918,23 +1918,25 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
||||||
boolean enable = BleManager.getInstance().isBlueEnable();
|
boolean enable = BleManager.getInstance().isBlueEnable();
|
||||||
if (enable) {
|
if (enable) {
|
||||||
|
L.i("jjjia-----------蓝牙可用-开始扫描--");
|
||||||
BleManager.getInstance().scan(new BleScanCallback() {
|
BleManager.getInstance().scan(new BleScanCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onScanFinished(List<BleDevice> scanResultList) {
|
public void onScanFinished(List<BleDevice> scanResultList) {
|
||||||
if (currentDevice!=null){ // 扫描结束,有设备
|
if (currentDevice!=null){ // 扫描结束,有设备
|
||||||
L.i("jjjia-----------scan---");
|
L.i("jjjia-----------scan- end--");
|
||||||
showDevice();
|
showDevice();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onScanStarted(boolean success) {
|
public void onScanStarted(boolean success) {
|
||||||
|
L.i("jjjia-----------scan- start--");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("MissingPermission")
|
@SuppressLint("MissingPermission")
|
||||||
@Override
|
@Override
|
||||||
public void onScanning(BleDevice bleDevice) {
|
public void onScanning(BleDevice bleDevice) {
|
||||||
|
L.i("jjjia-----------scan- ing--");
|
||||||
if (bleDevice!=null && bleDevice.getDevice()!=null){
|
if (bleDevice!=null && bleDevice.getDevice()!=null){
|
||||||
BluetoothDevice bean = bleDevice.getDevice();
|
BluetoothDevice bean = bleDevice.getDevice();
|
||||||
if (!TextUtils.isEmpty(bean.getName()) && bean.getName().startsWith("ifish")){
|
if (!TextUtils.isEmpty(bean.getName()) && bean.getName().startsWith("ifish")){
|
||||||
|
|
@ -1945,7 +1947,11 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else {
|
||||||
|
L.i("jjjia-----------蓝牙不可用---");
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
L.i("jjjia-----------没有扫描权限---");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//jjia-xpush
|
//jjia-xpush
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue