|
@@ -10144,22 +10144,100 @@ public class MainActivity extends WpadActivity {
|
|
|
*/
|
|
|
private void RecordDelayOn()
|
|
|
{
|
|
|
+
|
|
|
try {
|
|
|
+ Log.d(TAG, "[RecordDelayOn] Delay Start");
|
|
|
+ boolean isStrangeUse = false;
|
|
|
recordDelayHandler.removeMessages(0);
|
|
|
- Log.d(TAG, "[RecordDelay]");
|
|
|
- Common.bRecordDelay = true;
|
|
|
- //기존 핸들러 삭제 해야 함
|
|
|
- Message msg = recordDelayHandler.obtainMessage();
|
|
|
- msg.what = 0;
|
|
|
- recordDelayHandler.sendMessageDelayed(msg, 90 * 1000); // 녹화 종료 후 90초 동안 녹화를 막는다.
|
|
|
- //여기서 Auto Off 모드로 전송
|
|
|
|
|
|
- if(mSmartKeyRfDoorAPI == null && mWallPadAPI!=null ) mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
|
|
|
+ if (getStrangerRecordingManagerSetting()) {
|
|
|
+ if (getStrangerRecordingUserSetting()) {
|
|
|
+ isStrangeUse = true;
|
|
|
+ Log.d(TAG, "[RecordDelay]");
|
|
|
+ Common.bRecordDelay = true;
|
|
|
+ //기존 핸들러 삭제 해야 함
|
|
|
+ Message msg = recordDelayHandler.obtainMessage();
|
|
|
+ msg.what = 0;
|
|
|
+ recordDelayHandler.sendMessageDelayed(msg, 90 * 1000); // 녹화 종료 후 90초 동안 녹화를 막는다.
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI == null && mWallPadAPI!=null ) mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
|
|
|
+ //jglee - 2022.07.27 시나리오 변경에 따른 추가 설정
|
|
|
+ //딜레이 기간동안 LED 자동 OFF 실행
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status LED Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status Auto Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ //여기서 감지시간을 강제로 늘림
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x10);
|
|
|
+ Log.i(TAG, "[recordDelayHandler SenSorConfig] - Test Setting result = " + ret);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!isStrangeUse)
|
|
|
+ {
|
|
|
+ Common.bRecordDelay = false;
|
|
|
+ Log.i(TAG, "[RecordDelayOn] - Not Use Strange()");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 거동 수상자 사용설정
|
|
|
+ */
|
|
|
+ private void RecordNotUse(boolean isUse)
|
|
|
+ {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (getStrangerRecordingManagerSetting()) {
|
|
|
+ if (getStrangerRecordingUserSetting()) {
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI == null && mWallPadAPI!=null ) mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
|
|
|
+ //jglee - 2022.07.27 시나리오 변경에 따른 추가 설정
|
|
|
+ //딜레이 기간동안 LED 자동 OFF 실행
|
|
|
+
|
|
|
+ if(isUse)
|
|
|
+ {
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status LED Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_ON);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status Auto Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ //여기서 감지시간을 강제로 늘림
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x01);
|
|
|
+ Log.i(TAG, "[recordDelayHandler SenSorConfig] - Test Setting result = " + ret);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status LED Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
+ else Log.w(TAG, "[RecordDelayOn] Status Auto Off smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ //여기서 감지시간을 강제로 늘림
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x10);
|
|
|
+ Log.i(TAG, "[recordDelayHandler SenSorConfig] - Test Setting result = " + ret);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- //jglee - 2022.07.27 시나리오 변경에 따른 추가 설정
|
|
|
- //딜레이 기간동안 LED 자동 OFF 실행
|
|
|
- if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
- else Log.w(TAG, "[RecordDelayOn] smartKeyRfDoorAPI is null!!");
|
|
|
}
|
|
|
catch (Exception e)
|
|
|
{
|
|
@@ -10174,6 +10252,7 @@ public class MainActivity extends WpadActivity {
|
|
|
private void mediaStopRecord() {
|
|
|
try {
|
|
|
Log.d(TAG, "[mediaStopRecord]");
|
|
|
+ Log.d(TAG, "[mediaStopRecord] - RecordDelayOn()");
|
|
|
RecordDelayOn();
|
|
|
Common.bRecordStatus = false; // 녹화 종료
|
|
|
} catch (RuntimeException re) {
|
|
@@ -10194,14 +10273,88 @@ public class MainActivity extends WpadActivity {
|
|
|
public void handleMessage(Message msg) {
|
|
|
Common.bRecordDelay = false;
|
|
|
|
|
|
+ Log.d(TAG, "[recordDelayHandler] RecordDelay Init");
|
|
|
//jglee - 2022.07.27 시나리오 변경에 따른 추가 설정
|
|
|
//딜레이가 해제 되면 LED 자동 ON 실행
|
|
|
- if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
- else Log.w(TAG, "[ctrlSmartIOTCCamLEDMode]recordDelayHandler smartKeyRfDoorAPI is null!!");
|
|
|
+ if (getStrangerRecordingManagerSetting()) {
|
|
|
+ if (getStrangerRecordingUserSetting()) {
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
+ else Log.w(TAG, "[recordDelayHandler] Status LED ON smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_ON);
|
|
|
+ else Log.w(TAG, "[recordDelayHandler] Status Auto ON smartKeyRfDoorAPI is null!!");
|
|
|
+
|
|
|
+ //여기서 감지시간을 원래대로 복구
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x01);
|
|
|
+ Log.i(TAG, "[recordDelayHandler SenSorConfig] - Test Setting result = " + ret);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 스마트현관카메라 녹화 여부 판별
|
|
|
+ * 사용자 화면에서 설정
|
|
|
+ */
|
|
|
+ private boolean getStrangerRecordingUserSetting() {
|
|
|
+ boolean bResult = false;
|
|
|
+ WallpadStatusData DBMGR = new WallpadStatusData(this);
|
|
|
+ try {
|
|
|
+ bResult = DBMGR.GetStrangerRecordingOnOff();
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.d(TAG, "[getStrangerRecordingUserSetting] bResult [" + bResult + "]");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ DBMGR.closeDB();
|
|
|
+ bResult = false;
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.e(TAG, "[Exception] getStrangerRecordingUserSetting()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ bResult = false;
|
|
|
+ }
|
|
|
+ return bResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean getStrangerRecordingManagerSetting() {
|
|
|
+ boolean bResult = false;
|
|
|
+ WallpadDeviceSet mWallpadDeviceSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ try {
|
|
|
+ int[] nFrontCam = mWallpadDeviceSet.Get_RFDoorCAM_Info();
|
|
|
+ boolean bRecord = mWallpadDeviceSet.Get_Stranger_RecordUse();
|
|
|
+ mWallpadDeviceSet.closeDB();
|
|
|
+
|
|
|
+ if (nFrontCam[0] == 1) {
|
|
|
+ if (nFrontCam[1] == WallpadDeviceSet.DOORTYPE_IOT_SMART || nFrontCam[1] == WallpadDeviceSet.DOORTYPE_HYOSUNG_SMART || nFrontCam[1] == WallpadDeviceSet.DOORTYPE_DAEWOO_SMART) {
|
|
|
+ if (bRecord) bResult = true;
|
|
|
+ else bResult = false;
|
|
|
+ }
|
|
|
+ else bResult = false;
|
|
|
+ }
|
|
|
+ else bResult = false;
|
|
|
+
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ mWallpadDeviceSet.closeDB();
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ mWallpadDeviceSet.closeDB();
|
|
|
+ Log.e(TAG, "[Exception] getStrangerRecordingManagerSetting()");
|
|
|
+ //e.printStackTrace();
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ Log.d(TAG, "[getStrangerRecordingManagerSetting] bResult [" + bResult + "]");
|
|
|
+ return bResult;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 거동 수상자 관련 BR 등록
|
|
|
*/
|
|
@@ -10211,6 +10364,8 @@ public class MainActivity extends WpadActivity {
|
|
|
filter.addAction(Common.BR_RECORD_EXCEPTION);
|
|
|
filter.addAction(Common.BR_RECORD_STOP);
|
|
|
filter.addAction(Common.BR_RECORD_DELAY);
|
|
|
+ filter.addAction(Common.BR_RECORD_NOT_USE);
|
|
|
+ //filter.addAction(Common.BR_RECORD_USE);
|
|
|
mContext.registerReceiver(StrangeRecordBroadcastReceiver, filter);
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
@@ -10230,7 +10385,7 @@ public class MainActivity extends WpadActivity {
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
if(intent.getAction().equals(Common.BR_RECORD_EXCEPTION))
|
|
|
{
|
|
|
- Common.bRecordStatus = false;
|
|
|
+ mediaStopRecord();
|
|
|
}
|
|
|
else if(intent.getAction().equals(Common.BR_RECORD_STOP))
|
|
|
{
|
|
@@ -10238,8 +10393,13 @@ public class MainActivity extends WpadActivity {
|
|
|
}
|
|
|
else if(intent.getAction().equals(Common.BR_RECORD_DELAY))
|
|
|
{
|
|
|
+ Log.d(TAG, "BR - RecordDelayOn()");
|
|
|
RecordDelayOn();
|
|
|
}
|
|
|
+ else if(intent.getAction().equals(Common.BR_RECORD_NOT_USE))
|
|
|
+ {
|
|
|
+ RecordNotUse(false);
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
}
|