From baadd7ba4e194b95268dc9103dac2f9cf23f551b Mon Sep 17 00:00:00 2001 From: GiWoong Kim Date: Tue, 26 Nov 2013 15:41:50 +0900 Subject: [PATCH] config: modified getValidResolution function filter out the negative value from start-up arguments Change-Id: I4bdbff17fd4c7554ed465fb890d8dcfa686721d3 Signed-off-by: GiWoong Kim --- .../org/tizen/emulator/skin/config/EmulatorConfig.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java index 7286749..640159d 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java @@ -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 && -- 2.7.4