-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":81,"versionName":"202107081941","enabled":true,"outputFile":"ICL02Blood_V81_202107081941_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Blood_V81_202107081941_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":84,"versionName":"202107271558","enabled":true,"outputFile":"ICL02Blood_V84_202107271558_release.apk","fullName":"release","baseName":"release"},"path":"ICL02Blood_V84_202107271558_release.apk","properties":{}}]
\ No newline at end of file
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
+import android.media.AudioManager;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import com.xuexiang.xui.widget.dialog.DialogLoader;
import com.xuexiang.xui.widget.dialog.strategy.impl.MaterialDialogStrategy;
+import static android.media.AudioManager.FX_FOCUS_NAVIGATION_DOWN;
+
public class BloodPresenter {
public static final int STATE_ANTI_OFF = 1;
public static final int STATE_ANTI_NONE = -1;
- private BroadcastReceiver mAntiStateReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver mAntiStateReceiver = new BroadcastReceiver() {
+
+
+ private AudioManager audioManager = null;
+
@Override
public void onReceive(Context context, Intent intent) {
+ if (audioManager == null) {
+ audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
+ }
//如果来了佩戴的广播,判断到没有绑定远程服务的话,那么就绑定吧
int state = intent.getIntExtra(KEY_ANTI_EVENT, -1);
IcLog.i(TAG, "on AntiStateChange...." + state);
IcLog.i(TAG, "state error === > " + state);
return;
}
+ audioManager.playSoundEffect(FX_FOCUS_NAVIGATION_DOWN);
if (state == STATE_ANTI_OFF) {
//手表脱掉了0
mObsStateTips.postValue(mContext.getString(R.string.tips_not_wear));
}
};
+
/**
* 绑定远程服务
*/
if (dialog != null) {
dialog.dismiss();
}
- }catch (Exception e){
+ } catch (Exception e) {
Log.getStackTraceString(e.fillInStackTrace());
- }finally {
+ } finally {
updateBoolValue(heartRate.getBloodHeight(), heartRate.getBloodLow(),
heartRate.getHeartRate(), heartRate.getOxygen());
}
@Override
public void onClick(DialogInterface dialogInterface, int i) {
- if(dialogInterface != null){
+ if (dialogInterface != null) {
dialogInterface.dismiss();
}
- if(mActivity != null){
+ if (mActivity != null) {
mActivity.onBackPressed();
}
}