config: modified getValidResolution function 43/12943/1
authorGiWoong Kim <giwoong.kim@samsung.com>
Tue, 26 Nov 2013 06:41:50 +0000 (15:41 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 26 Nov 2013 06:44:47 +0000 (15:44 +0900)
filter out the negative value from start-up arguments

Change-Id: I4bdbff17fd4c7554ed465fb890d8dcfa686721d3
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java

index 7286749..640159d 100644 (file)
@@ -425,11 +425,23 @@ public class EmulatorConfig {
        }
 
        public int getValidResolutionWidth() {
-               return getArgInt(ArgsConstants.RESOLUTION_WIDTH);
+               final int storedValue = getArgInt(ArgsConstants.RESOLUTION_WIDTH, 1);
+
+               if (storedValue > 0) {
+                       return storedValue;
+               } else {
+                       return 1;
+               }
        }
 
        public int getValidResolutionHeight() {
-               return getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
+               final int storedValue = getArgInt(ArgsConstants.RESOLUTION_HEIGHT, 1);
+
+               if (storedValue > 0) {
+                       return storedValue;
+               } else {
+                       return 1;
+               }
        }
 
        /* java properties */
@@ -514,7 +526,7 @@ public class EmulatorConfig {
        }
 
        public int getValidScale() {
-               int storedScale = getSkinPropertyInt(
+               final int storedScale = getSkinPropertyInt(
                                SkinPropertiesConstants.WINDOW_SCALE, DEFAULT_WINDOW_SCALE);
 
                if (storedScale >= MIN_SCALE_FACTOR &&