Ver código fonte

Merge remote-tracking branch 'origin/master'

jslee(madeinlab) 3 anos atrás
pai
commit
608ae2532e

+ 1 - 1
WallPadCall/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="kr.co.icontrols.wallpadcall"
     android:versionCode="17"
-    android:versionName="2022.01.25.01">
+    android:versionName="2022.02.10.01">
 
     <!--android:sharedUserId="android.uid.system"-->
     <!--<uses-sdk-->

+ 12 - 1
WallPadCall/src/main/java/kr/co/icontrols/callengine/engine/CallController.java

@@ -2116,8 +2116,10 @@ public class CallController extends CallManager implements SIPEventListener {
                 MainActivity.mIOInterface.ctrlSetTalkPathDoor();
             }
             else {
+
                 // TalkPath Normal
                 if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300) {
+
                     ((MainActivity) mContext).sendHandlerMsg(IGW300CMD.AUDIO_OFF, 1, 0);
                 }
                 else if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
@@ -2126,7 +2128,16 @@ public class CallController extends CallManager implements SIPEventListener {
                 else if (ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40 || ConfigValues.DEVICE_BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
                     MainActivity.mIOInterface.ctrlSetTalkPathNormal();
                 }
-                sendHandlerMsg(HANDLERMSG.SETMODE_AUDIO_NORMAL, 0, 0);
+//                new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+//                    @Override
+//                    public void run() {
+//                        if(MainActivity.mAudioManager != null)
+//                            MainActivity.mAudioManager.setMode(AUDIO_MODE_NORMAL);
+//                    }
+//                }, 500);
+
+                //sendHandlerMsg(HANDLERMSG.SETMODE_AUDIO_NORMAL, 0, 0);
+
                 if (MainActivity.mIOInterface != null) {
                     MainActivity.mIOInterface.ctrlAudioSwitch34118(true);
                     MainActivity.mIOInterface.setWallPadSpeakerDefaultGain();

+ 33 - 5
WallPadCall/src/main/java/kr/co/icontrols/callengine/engine/VideoJNI.java

@@ -6,6 +6,8 @@ import kr.co.icontrols.wallpadcall.declare.Global.BOARD_TYPE;
 import kr.co.icontrols.wallpadcall.declare.Global.ConfigValues;
 
 import android.graphics.Bitmap;
+import android.os.Handler;
+import android.os.Looper;
 import android.util.Log;
 import android.view.Surface;
 import android.view.SurfaceView;
@@ -260,23 +262,39 @@ public class VideoJNI {
 
     public void decoderStopOperation() {
         try {
+            int nTime = 500;
             Log.d(TAG, "[decoderStopOperation] BOARDTYPE [" + BOARDTYPE + "], bDecoderStarted [" + bDecoderStarted + "], SWDecoderStarted [" + SWDecoderStarted + "]");
             if (BOARDTYPE == BOARD_TYPE.V40_IGW300) {
                 if (bDecoderStarted) {
                     bDecoderStarted = false;
-                    mV40IFCCD.decoderStopOperation();
+                    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            mV40IFCCD.decoderStopOperation();
+                        }
+                    }, nTime);
                 }
             }
             else if (BOARDTYPE == BOARD_TYPE.V40) {
                 if (bDecoderStarted) {
                     bDecoderStarted = false;
-                    mV40IFCCD.decoderStopOperation();
+                    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            mV40IFCCD.decoderStopOperation();
+                        }
+                    }, nTime);
                 }
             }
             else if (BOARDTYPE == BOARD_TYPE.V40_IGW300_NOUGAT) {
                 if (bDecoderStarted) {
                     bDecoderStarted = false;
-                    mV40IFCCD.decoderStopOperation();
+                    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            mV40IFCCD.decoderStopOperation();
+                        }
+                    }, nTime);
                 }
             }
             else if (BOARDTYPE == BOARD_TYPE.V40_NOUGAT) {
@@ -290,10 +308,20 @@ public class VideoJNI {
                             SWDecoderClose(1);
                             Log.e(TAG, "[decoderStopOperation] ========== JEFF 2 ========== SWDecoderStarted [" + SWDecoderStarted + "]");
                         }
-                        mV40IFCCD.decoderStopOperation();
+                        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                mV40IFCCD.decoderStopOperation();
+                            }
+                        }, nTime);
                     }
                     else {
-                        mV40IFCCD.decoderStopOperation();
+                        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                mV40IFCCD.decoderStopOperation();
+                            }
+                        }, nTime);
                     }
                 }
             }

+ 18 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/MainActivity.java

@@ -635,6 +635,8 @@ public class MainActivity extends WpadActivity {
             mNewDanjiServer =  wallpadDeviceSet.GetNewDanjiServer();
             wallpadDeviceSet.closeDB();
 
+            setDeviceName();
+
             LOG_INFO("[Create] - Step8 : Window Resize");
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);
@@ -645,6 +647,20 @@ public class MainActivity extends WpadActivity {
         }
     }
 
+    private void setDeviceName()
+    {
+        String[] strEndIP = {"10.1.1.1", "10.1.2.1", "10.1.3.1", "10.1.3.2", "10.1.1.3", "10.1.1.2", "10.1.2.2"};
+        String[] strEndName = {"1층", "2층", "3층", "안방", "기사", "메이드", "주방"};
+
+        for(int i = 0; i < strEndIP.length; i++)
+        {
+            if (ConfigValues.strDeviceIPaddress.equals(strEndIP[i])) {
+                Global.strDeviceName = strEndName[i];
+                break;
+            }
+        }
+
+    }
     public boolean getKakaoHomeCheck()
     {
         boolean result  = false;
@@ -668,6 +684,8 @@ public class MainActivity extends WpadActivity {
         mSound.StopAll();
         mSound.Release();
 
+        MainActivity.mAudioManager.setMode(AudioManager.MODE_NORMAL);
+
         finishPopUp(ID.POPUP.POPUP_ALL);
         finishManual(ID.MANUAL.MANUAL_ALL);
         sendHandlerMsg(HANDLERMSG.RECOVER_SYSTEM_VOLUME, 0, 0);

+ 2 - 0
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/declare/Global.java

@@ -77,6 +77,8 @@ public final class Global {
 
     static Context mContext;
 
+    public static String strDeviceName = "";
+
     public static boolean bEnableDeviceInput = false;   // 부팅이 완료되기 전까지 모든 입력(버튼, 시리얼, iMAP)을 차단하기 위한 변수
     public static boolean bEnablePSTN = false;   // 부팅이 완료되기 전까지 모든 입력(버튼, 시리얼, iMAP)을 차단하기 위한 변수
 //    public static boolean bFrontMonitoring = false;   // 현관탭을 눌러 현관통화화면 진입시, 현관 모니터링 시작을 위한 변수

+ 50 - 10
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/InquiryCallHistory.java

@@ -490,6 +490,8 @@ public class InquiryCallHistory extends WpadScreen implements CallEventListener,
                             String strSIPID = call_history_inquiry.GetAttributeVal(i, "recv_id_high") + "동" + call_history_inquiry.GetAttributeVal(i, "recv_id_low") + "호";
                             String strTimestamp = call_history_inquiry.GetAttributeVal(i, "event_time");
 
+                            LOG_INFO("[send_call_history_inquiry] " + i + " strName : " + strName + " strCallResult : " + strCallResult + " strRemoteIP : " + strRemoteIP);
+
                             mInfoTable.addCallHistoryInfo("", strName, strCallResult, strRemoteIP, strSIPID, "", "", strTimestamp);
 
                             mAllInfoTable.addCallHistoryInfo(call_history_inquiry.GetAttributeVal(i, "event_time"),
@@ -1047,6 +1049,27 @@ public class InquiryCallHistory extends WpadScreen implements CallEventListener,
         }
     }
 
+    private String getNameTitleText(String strIPAddress) {
+        try {
+            //CALLTYPE eCallType = Global.getCallType(strIPAddress);
+
+            if (strIPAddress.equals("doorcamera")) return "현관";
+            else if (strIPAddress.equals("lobby"))
+                return "로비";
+            else if (strIPAddress.equals("homedev"))
+                return "이웃";
+            else return "경비실";
+        } catch (RuntimeException re) {
+            LogUtil.errorLogInfo("", TAG, re);
+            return "경비실";
+        } catch (Exception e) {
+            Log.e(TAG, "[Exception] getNameImgText(String strIPAddress)");
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
+            return "경비실";
+        }
+    }
+
     private boolean activateTalkBTN(String strName) {
         try {
             if (strName.contains("로비")) return false;
@@ -1131,21 +1154,23 @@ public class InquiryCallHistory extends WpadScreen implements CallEventListener,
                 mLIST_VALUE[i].CHECK = false;
                 if (i < nInfoCnt) {
                     mLIST_VALUE[i].ID = mInfoTable.getCallHistoryInfo(i+iListCount).getID();
-                    if (mInfoTable.getCallHistoryInfo(i).getName().equals("lobby")) {
-                        mLIST_VALUE[i].NAME =  "101동 10번 로비";
+
+
+                    mLIST_VALUE[i].TIME = makeUnitTimestamp(mInfoTable.getCallHistoryInfo(i+iListCount).getTimestamp());
+                    mLIST_VALUE[i].TYPE = makeUnitType(mInfoTable.getCallHistoryInfo(i+iListCount).getCallResult());
+                    mLIST_VALUE[i].REMOTE_IP = mInfoTable.getCallHistoryInfo(i+iListCount).getName();
+
+                    if (mLIST_VALUE[i].REMOTE_IP.equals("lobby")) {
+                        mLIST_VALUE[i].NAME =  "정문 로비";
                     }
-                    else if (mInfoTable.getCallHistoryInfo(i+iListCount).getName().equals("homedev")) {
+                    else if (mLIST_VALUE[i].REMOTE_IP.equals("homedev")) {
                         //String[] strEndIP = {"10.1.1.1", "10.1.2.1", "10.1.3.1", "10.1.3.2", "10.1.1.3", "10.1.1.2", "10.1.2.2"};
                         mLIST_VALUE[i].NAME = makeResiType(mInfoTable.getCallHistoryInfo(i+iListCount).getSIPID());
                     }
-                    else if (mInfoTable.getCallHistoryInfo(i+iListCount).getName().equals("doorcamera")) {
+                    else if (mLIST_VALUE[i].REMOTE_IP.equals("doorcamera")) {
                         //String[] strEndIP = {"10.1.1.1", "10.1.2.1", "10.1.3.1", "10.1.3.2", "10.1.1.3", "10.1.1.2", "10.1.2.2"};
                         mLIST_VALUE[i].NAME =  "현관";
                     }
-
-                    mLIST_VALUE[i].TIME = makeUnitTimestamp(mInfoTable.getCallHistoryInfo(i+iListCount).getTimestamp());
-                    mLIST_VALUE[i].TYPE = makeUnitType(mInfoTable.getCallHistoryInfo(i+iListCount).getCallResult());
-                    mLIST_VALUE[i].REMOTE_IP = mInfoTable.getCallHistoryInfo(i+iListCount).getName();
                     mLIST_VALUE[i].NEW = "";
                     nStartIndex++;
                 } else {
@@ -1161,6 +1186,17 @@ public class InquiryCallHistory extends WpadScreen implements CallEventListener,
             for (int i = 0; i < nInfoCnt; i++) {
                 mLIST[i].IMG_NAME.setText(getNameImgText(mLIST_VALUE[i].REMOTE_IP));
                 mLIST[i].TXT_TYPE.setText(mLIST_VALUE[i].TYPE);
+
+//                if(getNameTitleText(mLIST_VALUE[i].REMOTE_IP).equals("이웃"))
+//                {
+//                    mLIST[i].TXT_NAME.setText(mLIST_VALUE[i].NAME);
+//                }
+//                else
+//                {
+//                    mLIST[i].TXT_NAME.setText(getNameTitleText(mLIST_VALUE[i].REMOTE_IP));
+//                }
+
+
                 mLIST[i].TXT_NAME.setText(mLIST_VALUE[i].NAME);
                 mLIST[i].TXT_TIME.setText(mLIST_VALUE[i].TIME);
                 mLIST[i].TXT_TYPE.setVisibility(View.VISIBLE);
@@ -1173,8 +1209,12 @@ public class InquiryCallHistory extends WpadScreen implements CallEventListener,
                 mLIST[i].IMG_NAME.setVisibility(View.VISIBLE);
                 mLIST[i].TXT_NAME.setVisibility(View.VISIBLE);
                 mLIST[i].TXT_TIME.setVisibility(View.VISIBLE);
-                if (activateTalkBTN(mLIST_VALUE[i].NAME))
-                    mLIST[i].BTN_TALK.setVisibility(View.VISIBLE);
+                if (activateTalkBTN(mLIST_VALUE[i].NAME)) {
+                    LOG_DEBUG("[getHistoryFromDB] Global.strDeviceName = " + Global.strDeviceName);
+                    LOG_DEBUG("[getHistoryFromDB] mLIST_VALUE[i].NAME = " + mLIST_VALUE[i].NAME);
+                    if(!Global.strDeviceName.contains(mLIST_VALUE[i].NAME))
+                        mLIST[i].BTN_TALK.setVisibility(View.VISIBLE);
+                }
                 if (mLIST_VALUE[i].NEW.equals("FALSE"))
                     mLIST[i].IMG_NEW.setVisibility(View.VISIBLE);
             }

+ 1 - 1
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkFront.java

@@ -2003,7 +2003,7 @@ public class TalkFront extends WpadScreen implements CallEventListener, MainEven
 
     private void setVolume(int nValue) {
         try {
-            if (!Global.setLobbyVolume(nValue)) {
+            if (!Global.setFrontVolume(nValue)) {
                 LOG_WARN("[setVolume] Fail to set volume!! nValue [" + nValue + "]");
             }
         } catch (RuntimeException re) {

+ 13 - 1
WallPadCall/src/main/java/kr/co/icontrols/wallpadcall/screen/TalkResidence.java

@@ -404,7 +404,13 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
                         // 통화중에 버튼 터치음을 발생시키면, 통화 상대방에게 터치음이 전달되므로 통화중에는 터치음을 출력하지 않는다.(JEFF, 2019.12.24)
                         if (MainActivity.mCallController.mCallInfo.getRESI() != CALLSTATUS.TALKING) MainActivity.mSound.Play(SND.effect.TOUCH_LATCHED);
 
-                        BTN_END.setButtonEventOffEnable(R.drawable.btn_residence_end_disabled2);
+                        if (ConfigValues.bWallPadCameraEnable) {
+                            BTN_END.setButtonEventOffEnable(R.drawable.btn_residence_end_disabled2);
+                        }
+                        else
+                        {
+                            BTN_END.setButtonEventOffEnable(R.drawable.btn_residence_end_disabled3);
+                        }
 
                         m_bCallStartBtnEnable = true;
                         new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
@@ -1544,6 +1550,7 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
 
     private void doAutoCall() {
         try {
+
             Log.e(TAG, "[doAutoCall] RemoteIDInfo.bAutoCall [" + RemoteIDInfo.bAutoCall + "]");
             if (RemoteIDInfo.bAutoCall) {
                 RemoteIDInfo.bAutoCall = false;
@@ -1572,6 +1579,7 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
 
     private void doAutoCall_sub() {
         try {
+
             Log.e(TAG, "[doAutoCall_sub] RemoteIDInfo.bAutoCall [" + RemoteIDInfo.bAutoCall + "]");
             if (RemoteIDInfo.bAutoCall) {
                 RemoteIDInfo.bAutoCall = false;
@@ -1635,6 +1643,8 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
                 LOG("[procAddCall] No MultiCall!!");
                 // 멀티콜 없음
                 if (RemoteIDInfo.bAutoCall) {
+                    if (ConfigValues.bWallPadCameraEnable) BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
+                    else BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
                     doAutoCall();   // 멀티콜 상황이 아닌경우 자동호출을 수행함
                 }
                 MainActivity.mCallController.mCallInfo.resetMultiCallInfo();
@@ -1690,6 +1700,8 @@ public class TalkResidence extends WpadScreen implements CallEventListener, Main
                 ((MainActivity) mContext).changeMenuNScreen(ID.MENU.MENU_TALKGUARD);
                 return true;
             } else if (eCallType == CALLTYPE.RESIDENCE) {
+                if (ConfigValues.bWallPadCameraEnable) BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled3);
+                else BTN_TALK.setButtonEventOffEnable(R.drawable.btn_residence_call_disabled2);
                 doAutoCall();
                 return true;
             } else {