Browse Source

2022.01.06 VIP
1. imapserver 수정.

DESKTOP-UNEGUH3\MadeinLab_SW_02 3 years ago
parent
commit
f292736e4c

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

@@ -1,7 +1,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="kr.co.icontrols.wallpadmain"
     android:versionCode="17"
-    android:versionName="2021.11.17.02">
+    android:versionName="2022.01.04.01">
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

+ 43 - 17
WallPadMain/src/main/java/kr/co/icontrols/wallpadmain/util/iMapServer.java

@@ -26,6 +26,7 @@ import android.os.RemoteException;
 import android.provider.Settings;
 import android.util.Log;
 import android.view.KeyEvent;
+import android.view.View;
 
 import com.artncore.WallPadDataMgr.WallpadCarEventInfo;
 import com.artncore.WallPadDataMgr.WallpadDevStatus;
@@ -146,6 +147,7 @@ public class iMapServer extends Service {
     String IPaddr;
     String AddrDong;
     String AddrHo;
+    boolean m_CallAppRunDelay = false; //add KSJ
     int ho;
     boolean log_sw = true;
     String SVRIP = "";
@@ -3377,30 +3379,43 @@ public class iMapServer extends Service {
                                 sip_result = "fail";
                             }
 
-                            retXML = XMLHeader + "<service type=\"reply\" name=\"check_sip_activation\" result=\"" + sip_result + "\">\r\n    <message>\"null\"</message>\r\n</service>\r\n</imap>\r\n";
+                            if(m_CallAppRunDelay == false)
+                            {
+                                retXML = XMLHeader + "<service type=\"reply\" name=\"check_sip_activation\" result=\"" + sip_result + "\">\r\n    <message>\"null\"</message>\r\n</service>\r\n</imap>\r\n";
+
+
+                                //add KSJ 2021.11.02 check_sip_activation msg recv 이후 wallpadcall app start
+                                String[] IP_Parse = strIP.split("\\.");
+                                Log.d(TAG, "1" + strIP);
+                                //Log.d(TAG, "2" + strSplit[1]);
+                                //Log.d(TAG, "3" + strSplit[2]);
+                                //Log.d(TAG, "4" + strSplit[3]);
+                                CALLTYPE eCallType = CALLTYPE.LOBBY;
+                                if (IP_Parse[2].equals("0")) {
 
-                            //add KSJ 2021.11.02 check_sip_activation msg recv 이후 wallpadcall app start
-                            String[] IP_Parse = strIP.split("\\.");
-                            Log.d(TAG, "1" + strIP);
-                            //Log.d(TAG, "2" + strSplit[1]);
-                            //Log.d(TAG, "3" + strSplit[2]);
-                            //Log.d(TAG, "4" + strSplit[3]);
-                            CALLTYPE eCallType = CALLTYPE.LOBBY;
-                            if (IP_Parse[2].equals("0")) {
+                                    eCallType = CALLTYPE.LOBBY;
 
-                                eCallType = CALLTYPE.LOBBY;
+                                    if (IP_Parse[3].equals("11"))
+                                        eCallType = CALLTYPE.FRONT;
 
-                                if (IP_Parse[3].equals("11"))
+                                } else if (IP_Parse[2].equals("129")) {
                                     eCallType = CALLTYPE.FRONT;
+                                } else {
+                                    eCallType = CALLTYPE.RESIDENCE;
+                                }
+
+                                if ((eCallType == CALLTYPE.LOBBY) || (eCallType == CALLTYPE.FRONT)) {
+                                    m_CallAppRunDelay = true;
+                                    runCallMainActivity_moip(CALLEVENTTYPE.RECEIVE_CALL, eCallType, strIP);
+                                }
+                            }
+                            else
+                            {
+                                sip_result = "fail";
+                                retXML = XMLHeader + "<service type=\"reply\" name=\"check_sip_activation\" result=\"" + sip_result + "\">\r\n    <message>\"null\"</message>\r\n</service>\r\n</imap>\r\n";
 
-                            } else if (IP_Parse[2].equals("129")) {
-                                eCallType = CALLTYPE.FRONT;
-                            } else {
-                                eCallType = CALLTYPE.RESIDENCE;
                             }
 
-                            if ((eCallType == CALLTYPE.LOBBY) || (eCallType == CALLTYPE.FRONT))
-                                runCallMainActivity_moip(CALLEVENTTYPE.RECEIVE_CALL, eCallType, strIP);
                         }
                         //add KSJ 2021.11.02 stop_talking msg 추가 (wallpadcall 종료)
                         else if (cmd.equals("stop_talking")) {
@@ -14524,9 +14539,20 @@ public class iMapServer extends Service {
                 mIntent.setComponent(mComponentName);
                 startActivity(mIntent);
                 Thread.sleep(500);   // Call app이 실행되는 시간을 기다려준다. (빨리 띄우면 이벤트를 수신 못함)
+
+                new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        Log.w(TAG, "[runCallMainActivity_moip] m_CallAppRunDelay " + m_CallAppRunDelay);
+                        m_CallAppRunDelay = false;
+                    }
+                }, 3000);
             } else {
                 Log.w(TAG, "[runCallMainActivity_moip] WallPadCall is already running!!");
+                m_CallAppRunDelay = false;
             }
+
+
         } catch (RuntimeException re) {
             LogUtil.errorLogInfo("", TAG, re);
         } catch (Exception e) {