messageBox.open();
temp.dispose();
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);;
}
}
"Failed to get identifier of the shared memory segment.",
SWT.ICON_ERROR, config);
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);
} else if (result == 2) {
logger.severe("Failed to attach the shared memory segment.");
SkinUtil.openMessage(shell, null,
"Failed to attach the shared memory segment.",
SWT.ICON_ERROR, config);
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);
}
/* display updater thread */
shell.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);
}
});
}
messageBox.open();
temp.dispose();
- System.exit(-1);
+ return;
}
SocketCommunicator communicator = null;
messageBox.open();
temp.dispose();
- System.exit(-1);
+ terminateImmediately(-1);
}
String skinInfoResolutionW =
messageBox.open();
temp.dispose();
- System.exit(-1);
+ terminateImmediately(-1);
}
logger.info("dbi version : " + dbiContents.getDbiVersion());
if (null != communicator) {
communicator.terminate();
} else {
- System.exit(-1);
+ terminateImmediately(-1);
}
} finally {
ImageRegistry.getInstance().dispose();
return properties;
}
+
+ public static void terminateImmediately(int exit) {
+ if (logger != null) {
+ logger.info("shutdown immediately! exit value : " + exit);
+ }
+
+ System.exit(exit);
+ }
}
byte[] receivedData = getReceivedData(miscDataTransfer);
if (null != receivedData) {
- String strLayer = new String(receivedData, 0, 1);
- String strValue = new String(receivedData, 1, length - 2);
+ String strLayer = new String(receivedData, 0, 1, "UTF-8");
+ String strValue = new String(receivedData, 1, length - 2, "UTF-8");
int layer = 0;
int value = 0;
byte[] receivedData = getReceivedData(miscDataTransfer);
if (null != receivedData) {
- String strValue = new String(receivedData, 0, length - 1);
+ String strValue = new String(receivedData, 0, length - 1, "UTF-8");
int value = 1;
try {
byte[] receivedData = getReceivedData(miscDataTransfer);
if (null != receivedData) {
- String strValue = new String(receivedData, 0, length - 1);
+ String strValue = new String(receivedData, 0, length - 1, "UTF-8");
int value = 1;
try {
} else {
BufferedReader reader = null;
try {
- reader = new BufferedReader(
- new FileReader(versionFilePath));
+ reader = new BufferedReader(new FileReader(file));
} catch (FileNotFoundException e) {
logger.warning(e.getMessage());
}
infoData = new String(receivedData, "UTF-8");
} catch (UnsupportedEncodingException e) {
logger.warning("unsupported encoding exception");
- infoData = new String(receivedData);
+ infoData = null;
}
} else {
logger.severe("Fail to get detail info");
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.skin.EmulatorSkin;
+import org.tizen.emulator.skin.EmulatorSkinMain;
import org.tizen.emulator.skin.comm.ICommunicator.RotationInfo;
import org.tizen.emulator.skin.config.EmulatorConfig;
import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
"Failed to read display information for skin.\n" +
"Check the contents of skin dbi file.",
SWT.ICON_ERROR, config);
- System.exit(-1);
+
+ EmulatorSkinMain.terminateImmediately(-1);
}
logger.info("display bounds : " + displayBounds);
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Shell;
import org.tizen.emulator.skin.EmulatorSkin;
+import org.tizen.emulator.skin.EmulatorSkinMain;
import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType;
import org.tizen.emulator.skin.comm.ICommunicator.SendCommand;
import org.tizen.emulator.skin.comm.sock.SocketCommunicator;
logger.severe("Failed to load initial skin image file. Kill this skin process.");
SkinUtil.openMessage(shell, null,
"Failed to load Skin image file.", SWT.ICON_ERROR, config);
- System.exit(-1);
+
+ EmulatorSkinMain.terminateImmediately(-1);
}
/* open the key window if key window menu item was enabled */
"Failed to read display information for skin.\n" +
"Check the contents of skin dbi file.",
SWT.ICON_ERROR, config);
- System.exit(-1);
+
+ EmulatorSkinMain.terminateImmediately(-1);
}
logger.info("display bounds : " + displayBounds);
import java.util.logging.LogRecord;
import java.util.logging.Logger;
+import org.tizen.emulator.skin.EmulatorSkinMain;
import org.tizen.emulator.skin.util.StringUtil;
/**
System.err.println("[SkinLog:error] "
+ "Cannot create skin log file. path : " + file.getAbsolutePath());
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);
return;
}
} catch (IOException e) {
e.printStackTrace();
- System.exit(-1);
+ EmulatorSkinMain.terminateImmediately(-1);
return;
}
}
public static final String KEYWINDOW_LAYOUT_ROOT = "keywindow-layout";
public static final String DBI_FILE_NAME = "default.dbi";
- private EmulatorSkin skin;
private SpecialKeyWindowImageRegistry imageRegistry;
private SocketCommunicator communicator;
public SpecialKeyWindow(EmulatorSkin skin, String layoutName) {
super(skin.getShell(), SWT.RIGHT | SWT.CENTER);
- this.skin = skin;
this.parent = skin.getShell();
this.shell = new Shell(parent.getDisplay() /* for Mac & Always on Top */,
SWT.NO_TRIM | SWT.RESIZE | SWT.TOOL | SWT.NO_FOCUS);