[Title]modified for checking resource busy when umount sdcard
authorsungmin ha <sungmin82.ha@samsung.com>
Thu, 5 Jul 2012 12:13:47 +0000 (21:13 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Thu, 5 Jul 2012 12:13:47 +0000 (21:13 +0900)
[Type]Bugfix
[Module]eventinjector
[Priority]Major
[Jira#]N_SE-2253
[Redmine#]  // Redmine Isuue Number
[Problem]  // Problem Description
[Cause]  // Cause Description
[Solution] // Solution Description
[TestCase]  // Executed the test-target (How to)

org.tizen.device/src/org/tizen/device/sdcard/page/SdcardPage.java
org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java
package/pkginfo.manifest

index d7667c4..5eccdcf 100644 (file)
@@ -65,7 +65,7 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen
        private String[] RecordFormatList       = RecordFormat.getInstance().getList();
        Button button_mount, button_umount;
        
-       private boolean isMounted = false;
+       private boolean isMounted = false, umountOk = true;
        private boolean isOldEmul = false;
        
        @Override
@@ -101,9 +101,7 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen
                                else
                                {                               
                                        SDcardSocket.getInstance().isMounted = false;
-       
                                        sendMessage(1 + "\n" + cmbRecordFormat.getText() + "\n");
-                                       
                                        try {
                                                        new ProgressMonitorDialog(parent.getShell()).run(true, true,
                                                                        new IRunnableWithProgress() {
@@ -147,11 +145,8 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen
                });
                
                button_umount.addSelectionListener(new SelectionListener(){
-
                        @Override
                        public void widgetSelected(SelectionEvent event) {
-                               umntButtonClick();
-                               
                                sendMessage(0 + "\n");
                                try {
                                        new ProgressMonitorDialog(parent.getShell()).run(true, true,
@@ -168,6 +163,10 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen
                                                                                                if(!isMounted)
                                                                                                        break;
                                                                                                
+                                                                                               umountOk = SDcardSocket.getInstance().umountOk;
+                                                                                               if(!umountOk)
+                                                                                                       break;
+                                                                                               
                                                                                                Thread.sleep(100);
                                                                                        }
                                                                }
@@ -175,6 +174,16 @@ public class SdcardPage extends AbstractInjectorPage implements ISelectionListen
                                } catch (Exception e) {
                                        e.printStackTrace();
                                }
+                               
+                               if(!umountOk)
+                               {
+                                       // sdcard is already mounted from other emulator.
+                                       DialogUtil.openMessageDialog("This is sdcard message.\nDevice or resouece is busy.\nPlease try again later.");
+                                       mntButtonClick();
+                                       SDcardSocket.getInstance().umountOk = true;
+                               }
+                               else
+                                       umntButtonClick();
                        }
 
                        @Override
index f562103..93bdef0 100644 (file)
@@ -65,7 +65,7 @@ public class SDcardSocket {
        private Receiver receiverThread;
        private StatusReceiver statusReceiverThread;
 
-       public boolean isMounted = false;
+       public boolean isMounted = false, umountOk = true;
        private IDevice currentDevice = null;
 
        // Event ID
@@ -370,6 +370,7 @@ public class SDcardSocket {
                                                                isMounted = false;
                                                                SDpath_set.remove(SDpath);
                                                                currentSDpath = "unmounted";
+                                                               umountOk = true;
                                                }
                                                else if(actionId == 1)  // mounted
                                                {
@@ -390,6 +391,13 @@ public class SDcardSocket {
                                                                isDataWaiting = false;
                                                                currentSDpath = SDpath;
                                                }
+                                               else if(actionId == 4)  // umount failed
+                                               {
+                                                               umountOk = false;
+                                               }
+                                               else if(actionId == 5)  // mount failed
+                                               {
+                                               }
                                                else
                                                                continue;
                                        }
index 351037a..a8a17d7 100644 (file)
@@ -1,5 +1,5 @@
 Package:eventinjector-eplugin
-Version:0.2.30
+Version:0.2.31
 OS:linux
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
@@ -9,7 +9,7 @@ Install-dependency:common-eplugin[linux], base-ide-product[linux]
 Source:eventinjector-eplugin
 
 Package:eventinjector-eplugin
-Version:0.2.30
+Version:0.2.31
 OS:windows
 Build-host-os:linux
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>