import static com.enqualcomm.support.Constants.ACTION_ALARM_ADD_DATAPOINTS;
import static com.enqualcomm.support.Constants.ACTION_ALARM_ALARM_CHANGE;
import static com.enqualcomm.support.Constants.ACTION_ALARM_BLE_SCAN;
+import static com.enqualcomm.support.Constants.ACTION_ANTI_OFF0;
import static com.enqualcomm.support.Constants.ACTION_CHECK_ANTIOFF_EVENT;
import static com.enqualcomm.support.Constants.ACTION_CHECK_CUTOFF_EVENT;
import static com.enqualcomm.support.Constants.ACTION_EQC_ALARM;
import static com.enqualcomm.support.Constants.FROM_ALARM;
import static com.enqualcomm.support.Constants.FROM_SERVER;
import static com.enqualcomm.support.Constants.HEARTBEAT_ALARM;
+import static com.enqualcomm.support.Constants.KEY_ANTI_EVENT;
import static com.enqualcomm.support.Constants.KEY_SAVE_STEP_COUNT;
import static com.enqualcomm.support.Constants.KEY_STEP_COUNT;
import static com.enqualcomm.support.Constants.STEP_COUNT_ALARM_ACTION;
//如果防走丢的协议的话
ICLogger.d("getFZDWeatherInfo ... ");
coreService.getFZDWeatherInfo();
+ coreService.sendAntiStatus();
}, 30 * 1000);
}
//定时,3个小时获取一次天气
}
+ public void sendAntiStatus(){
+ if(Config.custom_name.equals("AA")) {
+ Intent intent = new Intent();
+ if (antiService.getCurrentAntiStatus()) {
+ intent.setAction(ACTION_ANTI_OFF0);
+ intent.putExtra(KEY_ANTI_EVENT, 0);
+ }else {
+ intent.setAction(ACTION_ANTI_OFF0);
+ intent.putExtra(KEY_ANTI_EVENT, 1);
+ }
+ sendBroadcast(intent);
+ }
+ }
private final IFZDService.Stub mFZDService = new IFZDService.Stub() {
@Override
public void onDetach(Connection paramConnection, Runtime paramRuntime) {
mSensorManager.unregisterListener(mSensorEventListener);
}
+
+ public boolean getCurrentAntiStatus() {
+ //current_anti_status == 2 表示表带 锁定 , ==12 表示表带非法解锁
+ //current_anti_status == 0 表示佩戴 ==10 表示脱腕
+ switch (current_anti_status) {
+ //佩戴
+ case STATUS_WEARED:
+ return true;
+ case STATUS_ANTI_OFF:
+ return false;
+ default:
+ break;
+ }
+ return false;
+ }
}