|
@@ -58,6 +58,7 @@ import com.artncore.wallpadapi.LightAPI;
|
|
|
import com.artncore.wallpadapi.MultiSwitchAPI;
|
|
|
import com.artncore.wallpadapi.SdbAPI;
|
|
|
import com.artncore.wallpadapi.Sdb_LivingRoomLightAPI;
|
|
|
+import com.artncore.wallpadapi.SmartKeyRfDoorAPI;
|
|
|
import com.artncore.wallpadapi.WallPadAPI;
|
|
|
import com.artncore.wallpadimap.RetProci;
|
|
|
import com.artncore.wallpadimap.WallPadiMAPNotifyAPI;
|
|
@@ -317,7 +318,11 @@ public class MainActivity extends WpadActivity {
|
|
|
|
|
|
public static int nMissedCallCnt = 0, nVisitorPicCnt = 0, nNoticeCnt = 0, nParcelCnt = 0, nPostCnt = 0, nElecVehicleChangingCnt = 0;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
+ * 카메라 API
|
|
|
+ */
|
|
|
+ SmartKeyRfDoorAPI mSmartKeyRfDoorAPI = null;
|
|
|
+
|
|
|
|
|
|
|
|
|
IconManager mIconManager;
|
|
@@ -1797,6 +1802,9 @@ public class MainActivity extends WpadActivity {
|
|
|
super.onDestroy();
|
|
|
}
|
|
|
|
|
|
+ boolean cv_bStrangerVideoRecordUsage;
|
|
|
+ boolean cv_bStrangerUserVideoRecordUsage;
|
|
|
+
|
|
|
|
|
|
* onResume
|
|
|
*/
|
|
@@ -1888,6 +1896,53 @@ public class MainActivity extends WpadActivity {
|
|
|
LogUtil.errorLogInfo("", TAG, e);
|
|
|
}
|
|
|
bScreenCheck = true;
|
|
|
+
|
|
|
+
|
|
|
+ WallpadDeviceSet mWallpadDeviceSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ cv_bStrangerVideoRecordUsage = mWallpadDeviceSet.Get_Stranger_RecordUse();
|
|
|
+ mWallpadDeviceSet.closeDB();
|
|
|
+
|
|
|
+ WallpadStatusData DBMGR = new WallpadStatusData(this);
|
|
|
+ try {
|
|
|
+ cv_bStrangerUserVideoRecordUsage = DBMGR.GetStrangerRecordingOnOff();
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.d(TAG, "[getStrangerRecordingUserSetting] bResult [" + cv_bStrangerUserVideoRecordUsage + "]");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ DBMGR.closeDB();
|
|
|
+ cv_bStrangerUserVideoRecordUsage = false;
|
|
|
+ } catch (Exception e) {
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.e(TAG, "[Exception] getStrangerRecordingUserSetting()");
|
|
|
+
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ cv_bStrangerUserVideoRecordUsage = false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (Version.getModelType() == Version.MODEL_TYPE.IHN_D101 || Version.getModelType() == Version.MODEL_TYPE.IHN_D101_I
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K || Version.getModelType() == Version.MODEL_TYPE.IHN_D101K_I
|
|
|
+ || Version.getModelType() == MODEL_TYPE.IHN_1010GL || Version.getModelType() == MODEL_TYPE.IHN_1010GL_I
|
|
|
+ || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_2443 || Version.getModelType() == Version.MODEL_TYPE.IHN_1010GL_I_6410
|
|
|
+ || Version.getModelType() == MODEL_TYPE.IHN_D101_I_OCF) {
|
|
|
+
|
|
|
+ new Handler().postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ WallPadInterface wpdifc = new WallPadInterface();
|
|
|
+ wpdifc.DoControl(WallPadInterface.IOCTL_VIDEOINPUT_DOORCAMERA, 0);
|
|
|
+ }
|
|
|
+ }, 2000);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
DebugLogOutput("@@@@@@@@ [onResume] @@@@@@@@");
|
|
|
}
|
|
|
|
|
@@ -2747,7 +2802,52 @@ public class MainActivity extends WpadActivity {
|
|
|
|
|
|
case Common.BR_MAIN_NOTI.ACCEPT_RECORDING:
|
|
|
int nEmerState = intent.getIntExtra("EMERGENCY_STATE", -1);
|
|
|
- m_CallSubMenuScreen.callStartCallAPK(ID.LINKEDSCREEN.SubCall.Door_Record, nEmerState);
|
|
|
+
|
|
|
+ Common.bRecordStatus = true;
|
|
|
+
|
|
|
+ boolean bFromCall = intent.getBooleanExtra("FROMCALL", false);
|
|
|
+
|
|
|
+ if (!bFromCall) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Intent brListIntent = new Intent();
|
|
|
+ brListIntent.setAction(define.NOTIFY_ACNAME);
|
|
|
+ brListIntent.putExtra(define.NOTIBR_KIND, define.NOTIFY_SMART_DCAM_DETECT);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Log.d(TAG, "jglee - Call Record");
|
|
|
+ m_CallSubMenuScreen.callStartCallAPK(ID.LINKEDSCREEN.SubCall.Door_Record, nEmerState);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case Common.BR_MAIN_NOTI.STOP_RECORDING:
|
|
|
+
|
|
|
+ Log.v("yjyoon", "Common.BR_MAIN_NOTI.STOP_RECORDING Common.bWallPadRecoder = false");
|
|
|
+
|
|
|
+ Common.bRecordStatus = false;
|
|
|
+
|
|
|
+ mediaStopRecord();
|
|
|
break;
|
|
|
|
|
|
default:
|
|
@@ -3617,6 +3717,8 @@ public class MainActivity extends WpadActivity {
|
|
|
|
|
|
registerMainActivityBR();
|
|
|
|
|
|
+ registerStrangeRecordBR();
|
|
|
+
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
}
|
|
@@ -3631,6 +3733,8 @@ public class MainActivity extends WpadActivity {
|
|
|
unregisterReceiver(mWallPadAlertBR);
|
|
|
unregisterReceiver(mWallPadNotifyBR);
|
|
|
unregisterReceiver(MainActivityBroadcastReceiver);
|
|
|
+
|
|
|
+ unregisterReceiver(StrangeRecordBroadcastReceiver);
|
|
|
} catch (RuntimeException re) {
|
|
|
LogUtil.errorLogInfo("", TAG, re);
|
|
|
}
|
|
@@ -10075,5 +10179,290 @@ public class MainActivity extends WpadActivity {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
+ * 거동 수상자 녹화 중지(MainActivity -> WallPadCall)
|
|
|
+ */
|
|
|
+ private void stopStrangerRecord() {
|
|
|
+ try {
|
|
|
+ Log.d(TAG, "[stopStrangerRecord] bRecordStatus [" + Common.bRecordStatus + "]");
|
|
|
+ if (Common.bRecordStatus) {
|
|
|
+ Common.bRecordStatus = false;
|
|
|
+
|
|
|
+
|
|
|
+ Intent iIntent = new Intent();
|
|
|
+ iIntent.setAction(Common.BR_REQUEST_RECORD_STOP);
|
|
|
+ iIntent.putExtra(define.NOTIBR_KIND, 1);
|
|
|
+ getApplicationContext().sendBroadcast(iIntent);
|
|
|
+
|
|
|
+ mediaStopRecord();
|
|
|
+ }
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] stopStrangerRecord(boolean bSave)");
|
|
|
+
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Handler StrangeDelayHandler = null;
|
|
|
+
|
|
|
+ Runnable strangedelay_runnable = new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (cv_bStrangerVideoRecordUsage) {
|
|
|
+ if (cv_bStrangerUserVideoRecordUsage) {
|
|
|
+ Log.d(TAG, "[RecordDelay]");
|
|
|
+ Common.bRecordDelay = true;
|
|
|
+
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI == null && mWallPadAPI!=null ) mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
|
|
|
+
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
+
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x240);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 연속 녹화 방지(10초간 막음)
|
|
|
+ */
|
|
|
+ private void RecordDelayOn()
|
|
|
+ {
|
|
|
+
|
|
|
+ try {
|
|
|
+ Log.d(TAG, "[RecordDelayOn] Delay Start bRecordDelay : " + Common.bRecordDelay);
|
|
|
+ boolean isStrangeUse = false;
|
|
|
+ recordDelayHandler.removeMessages(0);
|
|
|
+
|
|
|
+ if(StrangeDelayHandler == null)
|
|
|
+ StrangeDelayHandler = new Handler();
|
|
|
+
|
|
|
+ if(cv_bStrangerUserVideoRecordUsage && cv_bStrangerUserVideoRecordUsage)
|
|
|
+ {
|
|
|
+ if(!Common.bRecordDelay) {
|
|
|
+ StrangeDelayHandler.removeCallbacksAndMessages(null);
|
|
|
+ StrangeDelayHandler.post(strangedelay_runnable);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Message msg = recordDelayHandler.obtainMessage();
|
|
|
+ msg.what = 0;
|
|
|
+ recordDelayHandler.sendMessageDelayed(msg, 90 * 1000);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Common.bRecordDelay = false;
|
|
|
+ Log.i(TAG, "[RecordDelayOn] - Not Use Strange()");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 사용설정
|
|
|
+ */
|
|
|
+ private void RecordNotUse(boolean isUse)
|
|
|
+ {
|
|
|
+
|
|
|
+ try {
|
|
|
+ if (cv_bStrangerVideoRecordUsage) {
|
|
|
+ if (cv_bStrangerUserVideoRecordUsage) {
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI == null && mWallPadAPI!=null ) mSmartKeyRfDoorAPI = mWallPadAPI.Get_SmartKeyRfDoorController();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(isUse)
|
|
|
+ {
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_ON);
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_ON);
|
|
|
+
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x01);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetLEDmode(Common.SmartRFCamLEDMode.LED_AUTO_OFF);
|
|
|
+
|
|
|
+ if (mSmartKeyRfDoorAPI != null) mSmartKeyRfDoorAPI.SetCAMERAmode(Common.SmartRFCamStatusMode.STATUS_AUTO_OFF);
|
|
|
+
|
|
|
+
|
|
|
+ if(mSmartKeyRfDoorAPI!=null)
|
|
|
+ {
|
|
|
+ String ret = mSmartKeyRfDoorAPI.SetSensorConfig((byte) 0x05, (byte)0x240);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 녹화 중지 관련 내부 변수 처리
|
|
|
+ */
|
|
|
+ private void mediaStopRecord() {
|
|
|
+ try {
|
|
|
+ Log.d(TAG, "[mediaStopRecord]");
|
|
|
+ Log.d(TAG, "[mediaStopRecord] - RecordDelayOn()");
|
|
|
+ RecordDelayOn();
|
|
|
+ Common.bRecordStatus = false;
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ } catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] mediaStopRecord()");
|
|
|
+
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 역속 녹화를 막기 위한 Handler
|
|
|
+ */
|
|
|
+ Handler recordDelayHandler = new Handler() {
|
|
|
+ @Override
|
|
|
+ public void handleMessage(Message msg) {
|
|
|
+ Common.bRecordDelay = false;
|
|
|
+
|
|
|
+ Log.d(TAG, "[recordDelayHandler] RecordDelay Init + CallingStatus : " +Common.bWallPadCallingLive);
|
|
|
+
|
|
|
+ if (cv_bStrangerVideoRecordUsage) {
|
|
|
+ if (cv_bStrangerUserVideoRecordUsage) {
|
|
|
+
|
|
|
+
|
|
|
+ if(!Common.bWallPadCallingLive)
|
|
|
+ {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 관련 BR 등록
|
|
|
+ */
|
|
|
+ private void registerStrangeRecordBR() {
|
|
|
+ try {
|
|
|
+ IntentFilter filter = new IntentFilter();
|
|
|
+ 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_DELAY_INIT);
|
|
|
+ mContext.registerReceiver(StrangeRecordBroadcastReceiver, filter);
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ }
|
|
|
+ catch (Exception e) {
|
|
|
+ Log.e(TAG, "[Exception] registerMainActivityBR()");
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 거동 수상자 관련 BR
|
|
|
+ */
|
|
|
+ BroadcastReceiver StrangeRecordBroadcastReceiver = new BroadcastReceiver() {
|
|
|
+ @Override
|
|
|
+ public void onReceive(Context context, Intent intent) {
|
|
|
+ if(intent.getAction().equals(Common.BR_RECORD_EXCEPTION))
|
|
|
+ {
|
|
|
+ mediaStopRecord();
|
|
|
+ }
|
|
|
+ else if(intent.getAction().equals(Common.BR_RECORD_STOP))
|
|
|
+ {
|
|
|
+ stopStrangerRecord();
|
|
|
+ }
|
|
|
+ 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))
|
|
|
+ {
|
|
|
+
|
|
|
+ Log.d(TAG, "RecordDelay isCalling");
|
|
|
+ RecordNotUse(false);
|
|
|
+ }
|
|
|
+ else if(intent.getAction().equals(Common.BR_RECORD_DELAY_INIT))
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Log.d(TAG, "Recrod Delay Init Config, RecordDelay Status :" + Common.bRecordDelay);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ WallpadDeviceSet mWallpadDeviceSet = new WallpadDeviceSet(getApplicationContext());
|
|
|
+ cv_bStrangerVideoRecordUsage = mWallpadDeviceSet.Get_Stranger_RecordUse();
|
|
|
+ mWallpadDeviceSet.closeDB();
|
|
|
+
|
|
|
+ WallpadStatusData DBMGR = new WallpadStatusData(getApplicationContext());
|
|
|
+ try {
|
|
|
+ cv_bStrangerUserVideoRecordUsage = DBMGR.GetStrangerRecordingOnOff();
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.d(TAG, "[getStrangerRecordingUserSetting] bResult [" + cv_bStrangerUserVideoRecordUsage + "]");
|
|
|
+ } catch (RuntimeException re) {
|
|
|
+ LogUtil.errorLogInfo("", TAG, re);
|
|
|
+ DBMGR.closeDB();
|
|
|
+ cv_bStrangerUserVideoRecordUsage = false;
|
|
|
+ } catch (Exception e) {
|
|
|
+ DBMGR.closeDB();
|
|
|
+ Log.e(TAG, "[Exception] getStrangerRecordingUserSetting()");
|
|
|
+
|
|
|
+ LogUtil.errorLogInfo("", TAG, e);
|
|
|
+ cv_bStrangerUserVideoRecordUsage = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!Common.bRecordDelay)
|
|
|
+ RecordNotUse(true);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|
|
|
|