|
@@ -19,6 +19,7 @@ import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
import android.os.Message;
|
|
import android.os.Message;
|
|
|
|
+import android.os.SystemProperties;
|
|
import android.speech.tts.TextToSpeech;
|
|
import android.speech.tts.TextToSpeech;
|
|
import android.support.annotation.Nullable;
|
|
import android.support.annotation.Nullable;
|
|
import android.support.design.widget.Snackbar;
|
|
import android.support.design.widget.Snackbar;
|
|
@@ -428,6 +429,8 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
private final int TURN_OFF_SCREEN = 2007;
|
|
private final int TURN_OFF_SCREEN = 2007;
|
|
private MyHandler handler = new MyHandler(this);
|
|
private MyHandler handler = new MyHandler(this);
|
|
|
|
|
|
|
|
+ private String SCREEN_OFF_LIGHT = "1";
|
|
|
|
+
|
|
class MyHandler extends Handler {
|
|
class MyHandler extends Handler {
|
|
// 弱引用 ,防止内存泄露
|
|
// 弱引用 ,防止内存泄露
|
|
private WeakReference<CallingBedActivity> weakReference;
|
|
private WeakReference<CallingBedActivity> weakReference;
|
|
@@ -578,6 +581,13 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
ScreenManagerUtil.setScreenBrightness(context, 210);
|
|
ScreenManagerUtil.setScreenBrightness(context, 210);
|
|
|
|
|
|
SoundPoolManager.getInstance().init();
|
|
SoundPoolManager.getInstance().init();
|
|
|
|
+
|
|
|
|
+ String model = SystemProperties.get("ro.product.model");
|
|
|
|
+ if ("WDFJ-I".equals(model)) {
|
|
|
|
+ SCREEN_OFF_LIGHT = "30";
|
|
|
|
+ } else if ("rk3128".equals(model)){
|
|
|
|
+ SCREEN_OFF_LIGHT = "1";
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1570,7 +1580,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
|
|
|
|
private void resetOffScreen() {
|
|
private void resetOffScreen() {
|
|
handler.removeMessages(TURN_OFF_SCREEN);
|
|
handler.removeMessages(TURN_OFF_SCREEN);
|
|
- if (StringUtils.notEmpty(Constants.MORNING_NIGTH) && Constants.MORNING_NIGTH.equals("1") && Constants.SCREENLIGHT.equals("1")) {//晚上
|
|
|
|
|
|
+ if (StringUtils.notEmpty(Constants.MORNING_NIGTH) && Constants.MORNING_NIGTH.equals("1") && Constants.SCREENLIGHT.equals(SCREEN_OFF_LIGHT)) {//晚上
|
|
handler.sendEmptyMessageDelayed(TURN_OFF_SCREEN, screenTimeOut);
|
|
handler.sendEmptyMessageDelayed(TURN_OFF_SCREEN, screenTimeOut);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1958,7 +1968,7 @@ public class CallingBedActivity extends BaseActivity implements ISerialPortBedOn
|
|
}
|
|
}
|
|
if (StringUtils.notEmpty(Constants.MORNING_NIGTH) && Constants.MORNING_NIGTH.equals("1")) {//晚上
|
|
if (StringUtils.notEmpty(Constants.MORNING_NIGTH) && Constants.MORNING_NIGTH.equals("1")) {//晚上
|
|
lightStatus = setWSHLight(serialPortUtil, true);
|
|
lightStatus = setWSHLight(serialPortUtil, true);
|
|
- if (Constants.SCREENLIGHT.equals("1")) {
|
|
|
|
|
|
+ if (Constants.SCREENLIGHT.equals(SCREEN_OFF_LIGHT)) {
|
|
if (!isVisible(vNurse) && !isVisible(vSupport) && !isVisible(vCall)) {//排除呼叫状态
|
|
if (!isVisible(vNurse) && !isVisible(vSupport) && !isVisible(vCall)) {//排除呼叫状态
|
|
showBlackView();
|
|
showBlackView();
|
|
}
|
|
}
|