javamanager/debugapi/src.s60/debugapiimpl.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: DebugApiImpl provides implementation for Degug API methods
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "debugapiimpl.h"
       
    20 
       
    21 #include "applauncher.h"
       
    22 #include "appinstaller.h"
       
    23 #include "appremover.h"
       
    24 
       
    25 #include "logger.h"
       
    26 #include "javauid.h"
       
    27 #include "javaprocessconstants.h"
       
    28 #include "javasymbianoslayer.h"
       
    29 
       
    30 using namespace java::debug;
       
    31 using namespace java::util;
       
    32 
       
    33 
       
    34 DebugApiImpl::DebugApiImpl()
       
    35 {
       
    36 }
       
    37 
       
    38 DebugApiImpl::~DebugApiImpl()
       
    39 {
       
    40 }
       
    41 
       
    42 int DebugApiImpl::installApp(const std::wstring& aFilename,
       
    43                              Uid& aSuiteUid,
       
    44                              std::list<Uid>& aAppUids)
       
    45 {
       
    46     JELOG2(EDebugApi);
       
    47 
       
    48     AppInstaller installer(aFilename);
       
    49     int rc = installer.install();
       
    50 
       
    51     if (!rc)
       
    52     {
       
    53         aSuiteUid = installer.getSuiteUid();
       
    54         aAppUids = installer.getAppUids();
       
    55     }
       
    56 
       
    57     return rc;
       
    58 }
       
    59 
       
    60 int DebugApiImpl::uninstallApp(const Uid& aSuiteUid)
       
    61 {
       
    62     JELOG2(EDebugApi);
       
    63 
       
    64     AppRemover installer(aSuiteUid);
       
    65     int rc = installer.uninstall();
       
    66 
       
    67     return rc;
       
    68 }
       
    69 
       
    70 int DebugApiImpl::startApp(const Uid& aAppUid, const std::wstring& aUeiParameters, pid_t& aPid)
       
    71 {
       
    72     JELOG2(EDebugApi);
       
    73 
       
    74     AppLauncher launcher(aAppUid);
       
    75     int rc = launcher.startApp(aUeiParameters);
       
    76     aPid = launcher.getPid();
       
    77     return rc;
       
    78 }
       
    79 
       
    80 int DebugApiImpl::stopApp(const Uid& aAppUid)
       
    81 {
       
    82     JELOG2(EDebugApi);
       
    83     AppLauncher launcher(aAppUid);
       
    84     return launcher.stopApp();
       
    85 }
       
    86