Просмотр исходного кода

[WallPadOutmodeRun]
1. 최신소스로 업데이트(2021.04.19 기준)

DESKTOP-FBA840V\icontrols 4 лет назад
Родитель
Сommit
4c400c5262

+ 68 - 21
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/MainActivity.java

@@ -22,6 +22,7 @@ import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
+import com.util.LogUtil;
 import kr.co.icontrols.wallpadoutmoderun.declare.Common;
 import kr.co.icontrols.wallpadoutmoderun.declare.ID;
 import kr.co.icontrols.wallpadoutmoderun.screen.OutModeSecurityRun;
@@ -39,7 +40,7 @@ import kr.co.icontrols.wallpadsupport.WpadUtil;
  * 를 여기서 처리한다.
  */
 public class MainActivity extends WpadActivity {
-    private final String TAG = "MainActivity";
+    static private final String TAG = "MainActivity";
 
     private final boolean DEBUG_LOG_ON = true;
     private void DebugLogOutput(String s) { if(DEBUG_LOG_ON) Log.d(TAG, s); }
@@ -129,7 +130,10 @@ public class MainActivity extends WpadActivity {
             Log.d(TAG, "OperationMode = MODE_NOMAL");
             try {
                 wpapi = new WallPadAPI(this);
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[ExceptionError] - new WallPadAPI : " + e);
             }
         }
@@ -228,8 +232,12 @@ public class MainActivity extends WpadActivity {
             IntentFilter filter = new IntentFilter();
             filter.addAction("Alarm Running");
             this.getContext().registerReceiver(m_EventAlarmBR, filter);
-        } catch (Exception e) {
-            e.printStackTrace();
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -237,8 +245,12 @@ public class MainActivity extends WpadActivity {
         try {
             am.cancel(pIntent);
             this.getContext().unregisterReceiver(m_EventAlarmBR);
-        } catch (Exception e) {
-            e.printStackTrace();
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -315,8 +327,11 @@ public class MainActivity extends WpadActivity {
                 Log.d(TAG , "AutoIGALStatusReleaseSinario bSet: " + bSet);
             }
             devset.closeDB();
-        } catch (Exception e) {
-
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -471,7 +486,10 @@ public class MainActivity extends WpadActivity {
                     OutModeReleaseLinkCtrl();
                     finish();
                 }
-            } catch (Exception e) {
+            } catch (RuntimeException re) {
+                LogUtil.errorLogInfo("", TAG, re);
+            }
+            catch (Exception e) {
                 Log.e(TAG, "[Exception Error] [onActivityResult] - data.getExtras().get");
             }
         }
@@ -532,7 +550,12 @@ public class MainActivity extends WpadActivity {
                     mCurrentScreenId = -1;
                     return false;
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+            mCurrentScreenId = -1;
+            return false;
+		}
+		catch (Exception e) {
             Log.e(TAG, "[ExceptionError] - setChangeScreen->Screen Create : " + e);
             mCurrentScreenId = -1;
             return false;
@@ -563,7 +586,10 @@ public class MainActivity extends WpadActivity {
                 }
             }
             wdb.closeDB();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.d(TAG, "[Exception]-" + e.toString());
         }
     }
@@ -581,9 +607,14 @@ public class MainActivity extends WpadActivity {
             intent.putExtra(Intent.EXTRA_KEY_EVENT, event);
             intent.putExtra("keycode",code);
             getContext().sendBroadcast(intent);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+            return -100;
+		}
+		catch (Exception e) {
             Log.e(TAG, "[setSendEventBR] - [Exception Error] code:" + code);
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             return -100;
         }
         return 0;
@@ -598,9 +629,13 @@ public class MainActivity extends WpadActivity {
             if (bEnable) TopManualBtn.setVisibility(View.VISIBLE);
             else TopManualBtn.setVisibility(View.INVISIBLE);
             ViewRegistration(TopLayout, TopManualBtn, marginLeft, 0);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e(TAG, "[Exception] setManualBtnVisible(boolean bEnable)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -629,9 +664,13 @@ public class MainActivity extends WpadActivity {
                 Log.d(TAG, "[getManualUse] Not Use Manual [2]");
                 return false;
             }
-        } catch (Exception ex) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception ex) {
             Log.e(TAG, "[getManualUse] - Exception !!!");
-            ex.printStackTrace();
+            //ex.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, ex);
         }
         return false;
     }
@@ -670,9 +709,13 @@ public class MainActivity extends WpadActivity {
     public static void resetCurrentManualScreenID() {
         try {
             mCurrentManualScreenId = -1;
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e("MainActivity", "[Exception] resetCurrentManualScreenID()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", "", e);
         }
     }
 
@@ -683,9 +726,13 @@ public class MainActivity extends WpadActivity {
                 mCurrentManualScreenId = -1;
                 mManualActivity.finish();
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e("MainActivity", "[Exception] FinishManualActivity()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", "", e);
         }
     }
 

+ 13 - 3
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/ManualActivity.java

@@ -14,6 +14,7 @@ import android.widget.RelativeLayout;
 
 import com.artncore.WallPadDataMgr.WallpadStatusData;
 import com.artncore.wallpadapi.WallPadAPI;
+import com.util.LogUtil;
 
 import kr.co.icontrols.wallpadoutmoderun.declare.Common;
 import kr.co.icontrols.wallpadoutmoderun.declare.ID;
@@ -93,7 +94,10 @@ public class ManualActivity extends WpadActivity {
         {
             wdb = new WallpadStatusData(this);
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e)
         {
             Log.e(TAG, "[Error] - WallpadStatusData Create : " + e);
         }
@@ -246,10 +250,16 @@ public class ManualActivity extends WpadActivity {
                     break;
             }
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+            mCurrentScreenId = -1;
+            return false;
+		}
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] - setChangeScreen->Screen Create: " + e.toString());
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
             mCurrentScreenId = -1;
             return false;
         }

+ 23 - 6
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/PopupActivity.java

@@ -14,6 +14,7 @@ import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.RelativeLayout;
+import com.util.LogUtil;
 import kr.co.icontrols.wallpadoutmoderun.declare.Common;
 import kr.co.icontrols.wallpadoutmoderun.declare.ID;
 import kr.co.icontrols.wallpadoutmoderun.screen.PopupInputPw;
@@ -116,7 +117,10 @@ public class PopupActivity extends WpadActivity
         }
 
         try { wdb = new WallpadStatusData(this); }
-        catch(Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) { Log.e(TAG, "[ExceptionError] - onCreate->WallpadStatusData Create : " + e); }
 
 
         // 4. Layout registration
@@ -334,7 +338,12 @@ public class PopupActivity extends WpadActivity
                     return false;
             }
         }
-        catch(Exception e)
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+            mCurrentScreenId = -1;
+            return false;
+		}
+		catch (Exception e)
         {
             Log.e(TAG, "[ExceptionError] - setChangeScreen->Screen Create : " + e);
             mCurrentScreenId = -1;
@@ -471,18 +480,26 @@ public class PopupActivity extends WpadActivity
             HandleMsg.arg1 = arg1;
             HandleMsg.arg2 = arg2;
             PopupScreenHandler.sendMessageDelayed(HandleMsg, delay);
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e(TAG, "[Exception] sendHandlerMsgDelayed(msg)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
     private void finishPopup() {
         try {
             super.finish();
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e(TAG, "[Exception] finishPopup()");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 4 - 4
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/imap/iMAPOutmoderun.java

@@ -82,10 +82,10 @@ public class iMAPOutmoderun extends WallPadiMAPClient{
             String result = GetAttributeVal(0, "result");
             if (result != null) {
                 if (result.equalsIgnoreCase("ok")) {
-                    if ((GetAttributeVal(0, "name")
-                            .equalsIgnoreCase("mode_changed"))
-                            && (GetAttributeVal(0, "type")
-                            .equalsIgnoreCase("reply"))) {
+                    String name = GetAttributeVal(0, "name");
+                    String type = GetAttributeVal(0, "type");
+                    if (name!=null && (name.equalsIgnoreCase("mode_changed"))
+                            && (type!=null && type.equalsIgnoreCase("reply"))) {
                         Proc.ProcSuccess();
                     }
                 } else if (result.equalsIgnoreCase("fail")) {

+ 8 - 2
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/screen/OutModeSecurityRun.java

@@ -77,7 +77,10 @@ public class OutModeSecurityRun extends WpadScreen{
             {
                 Common.command_iGW300(this.getContext(), Common.IGW300_SENSOR_CHECK);
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+            Log.d(TAG, "[Exception]-" + re.toString());
+		}
+		catch (Exception e) {
             Log.d(TAG, "[Exception]-" + e.toString());
         }
 
@@ -93,7 +96,10 @@ public class OutModeSecurityRun extends WpadScreen{
                 intent.putExtra("Called" , 1);
 
             getContext().sendBroadcast(intent);
-        }catch( Exception e )
+        } catch (RuntimeException re) {
+            Log.d(TAG, "[Exception]-" + re.toString());
+		}
+		catch (Exception e )
         {
             Log.d(TAG, "[Ctrl Exception]-" + e.toString());
         }

+ 8 - 2
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/screen/PopupInputPw.java

@@ -121,7 +121,10 @@ public class PopupInputPw extends WpadScreen
                 SamplePassWord = GetDB().GetUserPW();
                 Log.d(TAG, "[DB] ------****************--SamplePassWord : " + SamplePassWord);
             }
-        }catch( Exception e )
+        } catch (RuntimeException re) {
+            Log.d(TAG, "[Exception]-" + re.toString());
+		}
+		catch (Exception e )
         {
             Log.d(TAG, "[Exception]-" + e.toString());
         }
@@ -389,7 +392,10 @@ public class PopupInputPw extends WpadScreen
 
                     return true;
                 }
-            }catch( Exception e )
+            } catch (RuntimeException re) {
+                Log.d(TAG, "[Exception]-" + re.toString());
+            }
+            catch (Exception e )
             {
                 Log.d(TAG, "[Exception]-" + e.toString());
             }

+ 14 - 4
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/screen/manual/InputPwd_Manual.java

@@ -9,6 +9,8 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import kr.co.icontrols.wallpadoutmoderun.declare.Common;
+import com.util.LogUtil;
+
 import kr.co.icontrols.wallpadoutmoderun.declare.ID;
 import kr.co.icontrols.wallpadsupport.WpadImageView;
 import kr.co.icontrols.wallpadsupport.WpadScreen;
@@ -44,10 +46,14 @@ public class InputPwd_Manual extends WpadScreen {
                             "외부인의 침입으로 감지하여 침입경보를 발생시키고 경비실로 통보합니다.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] InputPwd_Manual");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -67,9 +73,13 @@ public class InputPwd_Manual extends WpadScreen {
             if (nEvent == MotionEvent.ACTION_UP) {
                 super.finish();
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }

+ 14 - 4
WallPadOutmodeRun/src/main/java/kr/co/icontrols/wallpadoutmoderun/screen/manual/OutMode_Manual.java

@@ -9,6 +9,8 @@ import android.view.View;
 import android.widget.RelativeLayout;
 
 import kr.co.icontrols.wallpadoutmoderun.declare.Common;
+import com.util.LogUtil;
+
 import kr.co.icontrols.wallpadoutmoderun.declare.ID;
 import kr.co.icontrols.wallpadsupport.WpadImageView;
 import kr.co.icontrols.wallpadsupport.WpadScreen;
@@ -47,10 +49,14 @@ public class OutMode_Manual extends WpadScreen {
                             "※ 외출방범 설정시 실내에 사람이 있는지 반드시 확인해 주십시오.");
 
         }
-        catch (Exception e)
+        catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e)
         {
             Log.e(TAG, "[Exception] OutMode_Manual");
-            e.printStackTrace();
+            //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 
@@ -70,9 +76,13 @@ public class OutMode_Manual extends WpadScreen {
             if (nEvent == MotionEvent.ACTION_UP) {
                 super.finish();
             }
-        } catch (Exception e) {
+        } catch (RuntimeException re) {
+			LogUtil.errorLogInfo("", TAG, re);
+		}
+		catch (Exception e) {
             Log.e(TAG, "[Exception] onTouchEvent(View v, MotionEvent event)");
-            e.printStackTrace();
+            //e.printStackTrace();            
+            LogUtil.errorLogInfo("", TAG, e);
         }
     }
 }