feat#145_蓝牙
This commit is contained in:
parent
4b47f7d16f
commit
3842e95435
|
|
@ -11,8 +11,8 @@ public class EventBean {
|
||||||
public String value;
|
public String value;
|
||||||
public int index = 0;
|
public int index = 0;
|
||||||
// jiaxblue
|
// jiaxblue
|
||||||
public static String BLUETOOTH_START_SCAN = "start_scan";
|
// public static String BLUETOOTH_START_SCAN = "start_scan";
|
||||||
public static String BLUETOOTH_STOP_SCAN = "stop_scan";
|
// public static String BLUETOOTH_STOP_SCAN = "stop_scan";
|
||||||
public static String TAB_INDEX = "tab_index";
|
public static String TAB_INDEX = "tab_index";
|
||||||
public static String LINK_FINISH = "link_finish";
|
public static String LINK_FINISH = "link_finish";
|
||||||
public static String CHANGE_DEVICE_NAME = "change_device_name";
|
public static String CHANGE_DEVICE_NAME = "change_device_name";
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import com.ifish.utils.ActivityManager;
|
||||||
import com.ifish.utils.ImageDownLoader;
|
import com.ifish.utils.ImageDownLoader;
|
||||||
import com.ifish.utils.L;
|
import com.ifish.utils.L;
|
||||||
import com.ifish.utils.SystemUtil;
|
import com.ifish.utils.SystemUtil;
|
||||||
|
import com.ifish.utils.ToastUtil;
|
||||||
import com.ifish.utils.TrustAllCerts;
|
import com.ifish.utils.TrustAllCerts;
|
||||||
import com.p2p.core.P2PSpecial.P2PSpecial;
|
import com.p2p.core.P2PSpecial.P2PSpecial;
|
||||||
import com.squareup.picasso.Picasso;
|
import com.squareup.picasso.Picasso;
|
||||||
|
|
@ -93,59 +94,65 @@ public class BaseApplication extends MultiDexApplication {
|
||||||
BleManager.getInstance().initScanRule(scanRuleConfig);
|
BleManager.getInstance().initScanRule(scanRuleConfig);
|
||||||
|
|
||||||
|
|
||||||
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
// registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
|
||||||
@Override
|
// @Override
|
||||||
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) {
|
// public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle bundle) {
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onActivityStarted(@NonNull Activity activity) {
|
// public void onActivityStarted(@NonNull Activity activity) {
|
||||||
if (count==0){
|
// if (count==0){
|
||||||
Activity activityName = ActivityManager.getInstance().lastActivity();
|
// ToastUtil.show(app,"aaa"+count);
|
||||||
if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
// L.i("jjia-x-----3-----"+count);
|
||||||
// jiaxblue
|
// Activity activityName = ActivityManager.getInstance().lastActivity();
|
||||||
EventBean eventBean = new EventBean(EventBean.BLUETOOTH_START_SCAN);
|
// if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
||||||
EventBus.getDefault().post(eventBean);
|
// L.i("jjia-x-----4-----"+count);
|
||||||
}
|
// // jiaxblue
|
||||||
}
|
// EventBean eventBean = new EventBean(EventBean.BLUETOOTH_START_SCAN);
|
||||||
count++;
|
// EventBus.getDefault().post(eventBean);
|
||||||
|
// }
|
||||||
}
|
// }
|
||||||
|
// count++;
|
||||||
@Override
|
//
|
||||||
public void onActivityResumed(@NonNull Activity activity) {
|
// }
|
||||||
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public void onActivityResumed(@NonNull Activity activity) {
|
||||||
@Override
|
//
|
||||||
public void onActivityPaused(@NonNull Activity activity) {
|
// }
|
||||||
|
//
|
||||||
}
|
// @Override
|
||||||
|
// public void onActivityPaused(@NonNull Activity activity) {
|
||||||
@Override
|
//
|
||||||
public void onActivityStopped(@NonNull Activity activity) {
|
// }
|
||||||
count--;
|
//
|
||||||
if (count==0){
|
// @Override
|
||||||
Activity activityName = ActivityManager.getInstance().lastActivity();
|
// public void onActivityStopped(@NonNull Activity activity) {
|
||||||
if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
// count--;
|
||||||
// jiaxblue
|
// ToastUtil.show(app,"bbbb"+count);
|
||||||
EventBean eventBean = new EventBean(EventBean.BLUETOOTH_STOP_SCAN);
|
// L.i("jjia-x-----0-----"+count);
|
||||||
EventBus.getDefault().post(eventBean);
|
// if (count==0){
|
||||||
}
|
// Activity activityName = ActivityManager.getInstance().lastActivity();
|
||||||
}
|
// if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
||||||
}
|
// L.i("jjia-x-----1-----"+count);
|
||||||
|
// // jiaxblue
|
||||||
@Override
|
// EventBean eventBean = new EventBean(EventBean.BLUETOOTH_STOP_SCAN);
|
||||||
public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {
|
// EventBus.getDefault().post(eventBean);
|
||||||
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
@Override
|
//
|
||||||
public void onActivityDestroyed(@NonNull Activity activity) {
|
// @Override
|
||||||
|
// public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle bundle) {
|
||||||
}
|
//
|
||||||
});
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onActivityDestroyed(@NonNull Activity activity) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -158,7 +165,6 @@ public class BaseApplication extends MultiDexApplication {
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||||
Log.i("ifish7", "LHD" + "---" + activity.getLocalClassName());
|
Log.i("ifish7", "LHD" + "---" + activity.getLocalClassName());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -1136,8 +1136,6 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
//// deviceAdapter.notifyDataSetChanged();
|
|
||||||
//// cameraAdapter.notifyDataSetChanged();
|
|
||||||
showDevice = PetDeviceGetDistinguish.getShowDevice(getContext());
|
showDevice = PetDeviceGetDistinguish.getShowDevice(getContext());
|
||||||
showCamera = PetDeviceGetDistinguish.getFishCameras(Commons.CAMERA);
|
showCamera = PetDeviceGetDistinguish.getFishCameras(Commons.CAMERA);
|
||||||
deviceAdapter = new DeviceFragmentAdapter(getActivity(), showDevice);
|
deviceAdapter = new DeviceFragmentAdapter(getActivity(), showDevice);
|
||||||
|
|
@ -1150,6 +1148,66 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
startDownTimer();
|
startDownTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStart() {
|
||||||
|
super.onStart();
|
||||||
|
Activity activityName = ActivityManager.getInstance().lastActivity();
|
||||||
|
if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
oonPause();
|
||||||
|
L.i("jjia-x-----xxx-----2");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
Activity activityName = ActivityManager.getInstance().lastActivity();
|
||||||
|
if (activityName!=null && activityName.toString().contains("MainTabActivity")){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// jiaxblue
|
||||||
|
public void onEventMainThread(EventBean eventBean){
|
||||||
|
if (eventBean!= null){
|
||||||
|
// if (EventBean.BLUETOOTH_START_SCAN.equals(eventBean.name)){
|
||||||
|
// L.i("jjia-x-----start-----");
|
||||||
|
// if (!isShowEd){
|
||||||
|
// initBooth();
|
||||||
|
// }
|
||||||
|
// }else if (EventBean.BLUETOOTH_STOP_SCAN.equals(eventBean.name)){
|
||||||
|
// L.i("jjia-x-----stop-----");
|
||||||
|
// if (!isShowIng){
|
||||||
|
// currentDevice = null;
|
||||||
|
// }
|
||||||
|
// if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
||||||
|
// BleManager.getInstance().cancelScan();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }else
|
||||||
|
if (EventBean.TAB_INDEX.equals(eventBean.name)){
|
||||||
|
currentIndex = eventBean.index;
|
||||||
|
L.i("jjia-x----tab_index--"+eventBean.index);
|
||||||
|
if (currentIndex == 0){
|
||||||
|
startDownTimer();
|
||||||
|
}else {
|
||||||
|
oonPause();
|
||||||
|
}
|
||||||
|
}else if (EventBean.HEADER.equals(eventBean.name)){
|
||||||
|
Glide.with(getActivity()).load(eventBean.value).into(iv_head);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void setUserInfo() {
|
private void setUserInfo() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1193,7 +1251,6 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
lv_camera.setAdapter(cameraAdapter);
|
lv_camera.setAdapter(cameraAdapter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Intent intent = new Intent();
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (int i1 = 0; i1 < Commons.DEVICE.size(); i1++) {
|
for (int i1 = 0; i1 < Commons.DEVICE.size(); i1++) {
|
||||||
if (showDevice.get(position).getDeviceId().equals(Commons.DEVICE.get(i1).getDeviceId())) {
|
if (showDevice.get(position).getDeviceId().equals(Commons.DEVICE.get(i1).getDeviceId())) {
|
||||||
|
|
@ -1206,88 +1263,6 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
sp.putBoolean(LoginSPKey.IS_CAMERA, Commons.IS_CAMERA);
|
sp.putBoolean(LoginSPKey.IS_CAMERA, Commons.IS_CAMERA);
|
||||||
Device clickItem = (Device) lv_device.getItemAtPosition(position);
|
Device clickItem = (Device) lv_device.getItemAtPosition(position);
|
||||||
AppRoute.newToStart(requireActivity(),clickItem,false);
|
AppRoute.newToStart(requireActivity(),clickItem,false);
|
||||||
// try {
|
|
||||||
// Integer controlAmount = Commons.DEVICE.get(Commons.DevicePosition).getControlAmount();
|
|
||||||
// Integer timerAmount = Commons.DEVICE.get(Commons.DevicePosition).getTimerAmount();
|
|
||||||
// String type = Commons.DEVICE.get(Commons.DevicePosition).type;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// L.i("jjia-------mainclick--type-"+type);
|
|
||||||
// L.i("jjia-------mainclick--"+Commons.DEVICE.get(Commons.DevicePosition).toString());
|
|
||||||
// if (Commons.FishKey.On.equals(Commons.DEVICE.get(Commons.DevicePosition).isBlacklist)) {//黑名单
|
|
||||||
// i.setClass(getActivity(), BlackListActivity.class);
|
|
||||||
// } else {
|
|
||||||
// if (Device.TYPE_1C.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainThree1CControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_AA.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainFiveControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_BD.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainFiveBDControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_2A.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainSix_2A_ControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_2B.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainFour_2B_ControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_3A.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainHot_3A_ControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_2F.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainSeven_2F_ControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_3F.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainFour_3F_ControlActivity.class);
|
|
||||||
// } else if (Device.TYPE_4F.equals(type) || Device.TYPE_5F.equals(type)) {
|
|
||||||
// i.setClass(getActivity(), MainSix_4F_ControlActivity.class);
|
|
||||||
// } else {
|
|
||||||
// if (controlAmount == null) {//如果控制器返回空 则默认给三控的页面
|
|
||||||
// i.setClass(getActivity(), MainThreeControlActivity.class);
|
|
||||||
// } else {
|
|
||||||
// i.setClass(getActivity(), MainThreeControlActivity.class);
|
|
||||||
// switch (controlAmount) {
|
|
||||||
// case 0: {
|
|
||||||
// i.setClass(getActivity(), MainZeroControlActivity.class);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 2: {
|
|
||||||
// i.setClass(getActivity(), MainTwoControlActivity.class);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 3: {
|
|
||||||
// i.setClass(getActivity(), MainThreeControlActivity.class);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 4: {
|
|
||||||
// if (timerAmount == 6) { // 可丽爱
|
|
||||||
// i.setClass(getActivity(), MainFiveControlActivity.class);
|
|
||||||
// } else {//4控
|
|
||||||
// i.setClass(getActivity(), MainFourControlActivity.class);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 5: {
|
|
||||||
// if (6 == timerAmount) {//5控六定时器 询多页面
|
|
||||||
// i.setClass(getActivity(), MainSixControlActivity.class);
|
|
||||||
// }
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// case 8: {
|
|
||||||
// i.setClass(getActivity(), MainEightControlActivity.class);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// default: {
|
|
||||||
// i.setClass(getActivity(), MainThreeControlActivity.class);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
|
|
||||||
// ClipData mClipData = ClipData.newPlainText("Label", e.getMessage() + getStackTrace(e));
|
|
||||||
// clipboardManager.setPrimaryClip(mClipData);
|
|
||||||
// Toast.makeText(getActivity(), "错误日志复制到剪贴板!", Toast.LENGTH_SHORT).show();
|
|
||||||
// i.setClass(getActivity(), MainThreeControlActivity.class);
|
|
||||||
// }
|
|
||||||
// startActivity(i);
|
|
||||||
// AnimationUtil.startAnimation(getActivity());
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
lv_camera.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
lv_camera.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
|
@ -1602,8 +1577,8 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
break;
|
break;
|
||||||
case R.id.rl_adddevice:
|
case R.id.rl_adddevice:
|
||||||
// jiaxblue
|
// jiaxblue
|
||||||
EventBean eventBean = new EventBean(EventBean.BLUETOOTH_STOP_SCAN);
|
// EventBean eventBean = new EventBean(EventBean.BLUETOOTH_STOP_SCAN);
|
||||||
EventBus.getDefault().post(eventBean);
|
// EventBus.getDefault().post(eventBean);
|
||||||
addDevice();
|
addDevice();
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1979,34 +1954,7 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
private boolean isShowEd = false;
|
private boolean isShowEd = false;
|
||||||
|
|
||||||
private int currentIndex = 0;
|
private int currentIndex = 0;
|
||||||
// jiaxblue
|
|
||||||
public void onEventMainThread(EventBean eventBean){
|
|
||||||
if (eventBean!= null){
|
|
||||||
if (EventBean.BLUETOOTH_START_SCAN.equals(eventBean.name)){
|
|
||||||
if (!isShowEd){
|
|
||||||
initBooth();
|
|
||||||
}
|
|
||||||
}else if (EventBean.BLUETOOTH_STOP_SCAN.equals(eventBean.name)){
|
|
||||||
if (!isShowIng){
|
|
||||||
currentDevice = null;
|
|
||||||
}
|
|
||||||
if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
|
||||||
BleManager.getInstance().cancelScan();
|
|
||||||
}
|
|
||||||
|
|
||||||
}else if (EventBean.TAB_INDEX.equals(eventBean.name)){
|
|
||||||
currentIndex = eventBean.index;
|
|
||||||
L.i("jjia-----tab_index--"+eventBean.index);
|
|
||||||
if (currentIndex == 0){
|
|
||||||
startDownTimer();
|
|
||||||
}else {
|
|
||||||
oonPause();
|
|
||||||
}
|
|
||||||
}else if (EventBean.HEADER.equals(eventBean.name)){
|
|
||||||
Glide.with(getActivity()).load(eventBean.value).into(iv_head);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showPermissionHint(){
|
private void showPermissionHint(){
|
||||||
|
|
||||||
|
|
@ -2028,38 +1976,39 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
});
|
});
|
||||||
openDialog.show();
|
openDialog.show();
|
||||||
}
|
}
|
||||||
|
AlertDialog alertDialog;
|
||||||
public void showDevice(){
|
public void showDevice(){
|
||||||
// 检测页面
|
// 检测页面
|
||||||
if (!isShowIng){
|
if (!isShowIng){
|
||||||
isShowIng = true;
|
isShowIng = true;
|
||||||
isShowEd = true;
|
isShowEd = true;
|
||||||
AlertDialog.Builder dialog = new AlertDialog.Builder(requireContext(), AlertDialog.THEME_HOLO_LIGHT);
|
|
||||||
dialog.setCancelable(true);
|
|
||||||
dialog.setTitle("提示");
|
|
||||||
dialog.setMessage("发现一个新设备是否去添加");
|
|
||||||
dialog.setOnDismissListener(dialogInterface -> isShowIng = false);
|
|
||||||
dialog.setNegativeButton("取消", (arg0, arg1) -> {
|
|
||||||
arg0.dismiss();
|
|
||||||
isShowIng = false;
|
|
||||||
startDownTimer();
|
|
||||||
|
|
||||||
});
|
alertDialog = new AlertDialog.Builder(requireActivity())
|
||||||
dialog.setPositiveButton("确定", (dialog1, which) -> {
|
.setTitle("提示")
|
||||||
dialog1.dismiss();
|
.setMessage("发现一个新设备是否去添加")
|
||||||
isShowIng = false;
|
.setOnDismissListener(dialogInterface -> isShowIng = false)
|
||||||
closeDownTimer();
|
.setPositiveButton("确定", (dialog, which) -> {
|
||||||
Intent intent = new Intent();
|
dialog.dismiss();
|
||||||
intent.setClass(requireActivity(), NewBindDeviceActivity.class);
|
isShowIng = false;
|
||||||
intent.putExtra("title", "连接水族箱");
|
closeDownTimer();
|
||||||
intent.putExtra("type", "bluetooth");
|
Intent intent = new Intent();
|
||||||
//jjia-xpush
|
intent.setClass(requireActivity(), NewBindDeviceActivity.class);
|
||||||
intent.putExtra("device", currentDevice);
|
intent.putExtra("title", "连接水族箱");
|
||||||
startActivity(intent);
|
intent.putExtra("type", "bluetooth");
|
||||||
AnimationUtil.finishAnimation(requireActivity());
|
//jjia-xpush
|
||||||
});
|
intent.putExtra("device", currentDevice);
|
||||||
dialog.show();
|
startActivity(intent);
|
||||||
|
AnimationUtil.finishAnimation(requireActivity());
|
||||||
|
})
|
||||||
|
.setNegativeButton("取消", (dialog, which) -> {
|
||||||
|
dialog.dismiss();
|
||||||
|
isShowIng = false;
|
||||||
|
startDownTimer();
|
||||||
|
})
|
||||||
|
.create();
|
||||||
|
|
||||||
|
alertDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int dowmCount = 1;
|
int dowmCount = 1;
|
||||||
|
|
@ -2109,28 +2058,30 @@ public class DeviceFragment extends BaseV4Fragment implements ObservableScrollVi
|
||||||
if (countDownTimer!=null){
|
if (countDownTimer!=null){
|
||||||
countDownTimer.cancel();
|
countDownTimer.cancel();
|
||||||
countDownTimer = null;
|
countDownTimer = null;
|
||||||
|
L.i("jjia-----dowmCount--xxx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//jjia-xpush
|
//jjia-xpush
|
||||||
private BleScanState getScanState(){
|
private BleScanState getScanState(){
|
||||||
return BleManager.getInstance().getScanSate();
|
return BleManager.getInstance().getScanSate();
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public void onPause() {
|
|
||||||
super.onPause();
|
|
||||||
oonPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void oonPause(){
|
private void oonPause(){
|
||||||
|
|
||||||
|
if (alertDialog!=null){
|
||||||
|
L.i("jjia---扫描暂停----------");
|
||||||
|
alertDialog.dismiss();
|
||||||
|
alertDialog.cancel();
|
||||||
|
alertDialog = null;
|
||||||
|
}
|
||||||
closeDownTimer();
|
closeDownTimer();
|
||||||
if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
if (AppUtil.checkSelfPermission(getContext(),permission_blue)) {
|
||||||
//jjia-xpush
|
//jjia-xpush
|
||||||
BleScanState scanState = getScanState();
|
BleScanState scanState = getScanState();
|
||||||
if (BleScanState.STATE_SCANNING.equals(scanState)) {
|
if (BleScanState.STATE_SCANNING.equals(scanState)) {
|
||||||
|
currentDevice = null;
|
||||||
BleManager.getInstance().cancelScan();
|
BleManager.getInstance().cancelScan();
|
||||||
L.i("jjia---扫描暂停----------");
|
L.i("jjia---扫描暂停----------");
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
L.i("jjia---扫描暂停-"+scanState);
|
L.i("jjia---扫描暂停-"+scanState);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue