Bug 240664 - Add option to uninstall MIDlet Suite
Summary: Add option to uninstall MIDlet Suite
Status: CLOSED FIXED
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.9   Edit
Assignee: Gustavo de Paula CLA
QA Contact:
URL:
Whiteboard:
Keywords: core
Depends on:
Blocks:
 
Reported: 2008-07-14 08:43 EDT by Gustavo de Paula CLA
Modified: 2008-10-15 09:24 EDT (History)
2 users (show)

See Also:


Attachments
patch for this bug (7.06 KB, patch)
2008-08-14 06:36 EDT, Gang(Allen) Ma CLA
wgp010: iplog+
wgp010: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo de Paula CLA 2008-07-14 08:43:15 EDT
After a MIDlet is executed over the air (OTA), the suite is installed on the emulator. The problem is that after that there is no way to uninstall the suite from MTJ.

in some emulators this force the user to manually delete the suite, before executing the MIDlet again
Comment 1 Gang(Allen) Ma CLA 2008-08-14 06:36:25 EDT
Created attachment 109973 [details]
patch for this bug

my solution is:

before launching in OTA, check if the specific MIDlet Suite has been installed in the emulator, if so, invoke the command "emulator -Xdevice:$DeviceName$ -Xjam:remove=$MIDsuite number$" to remove the installed MIDlet Suite.

all things are done at EmulatorLaunchConfigDelegate.preLaunchCheck().
Comment 2 Gang(Allen) Ma CLA 2008-08-14 06:56:37 EDT
The reason I found why Midlet Suite is not removed from emulator after launching in OTA mode:

the "emulator -Xjam:transient=URL" command will install, run, and remove an application. but for some SDKs, take Motorola SDK for example, after launching in OTA mode, if directly close the emulator but not click "back" button(or exit from application), the installed midlet suite will not be removed.

but I can't find some commands to remove the specific midlet suite forcely while launching, so my solution is to check that before launching in OTA.
Comment 3 Gustavo de Paula CLA 2008-08-30 15:08:17 EDT
hi gang,

i will evaluate this patch

:)
gep
Comment 4 Gustavo de Paula CLA 2008-09-09 09:43:41 EDT
hi gang,

i will commit this patch. the only change that i made was on the checkAndRemoveInstalledMidlet method. i changed the if statement to 
if (!(device instanceof JavaEmulatorDevice)){
instead of 
if (device instanceof AbstractCevice){

the problem is that the code cause a NPE on microemu and mpower sdk. since the fix is mostly applicable to UEI device probably this is is the best way to do the test

:)
gep
Comment 5 Gustavo de Paula CLA 2008-09-09 09:44:20 EDT
Comment on attachment 109973 [details]
patch for this bug

the code is ok to be committed. there is a single change that i did on  line of code
Comment 6 Gang(Allen) Ma CLA 2008-09-09 23:30:01 EDT
Hi Gustavo,

Thanks very much for your review.

your change works fine (because currently the non-JavaEmulatorDevice is just UEIDevice), but I think a better solution is to add an extension-point like "emulatorLaunchParticipant", so that toolkits can participate in the launching process.

But this may do lots of changes to the current code, so maybe we should keep it as it was, and do some changes if we need in the future. How do you think about it?

(In reply to comment #4)
> hi gang,
> i will commit this patch. the only change that i made was on the
> checkAndRemoveInstalledMidlet method. i changed the if statement to 
> if (!(device instanceof JavaEmulatorDevice)){
> instead of 
> if (device instanceof AbstractCevice){
> the problem is that the code cause a NPE on microemu and mpower sdk. since the
> fix is mostly applicable to UEI device probably this is is the best way to do
> the test
> :)
> gep

Comment 7 Gustavo de Paula CLA 2008-09-10 07:33:19 EDT
hi gang,

agreed! the code is committed and you can see it on next nightly build

:)
gep

(In reply to comment #6)
> Hi Gustavo,
> 
> Thanks very much for your review.
> 
> your change works fine (because currently the non-JavaEmulatorDevice is just
> UEIDevice), but I think a better solution is to add an extension-point like
> "emulatorLaunchParticipant", so that toolkits can participate in the launching
> process.
> 
> But this may do lots of changes to the current code, so maybe we should keep it
> as it was, and do some changes if we need in the future. How do you think about
> it?
> 
> (In reply to comment #4)
> > hi gang,
> > i will commit this patch. the only change that i made was on the
> > checkAndRemoveInstalledMidlet method. i changed the if statement to 
> > if (!(device instanceof JavaEmulatorDevice)){
> > instead of 
> > if (device instanceof AbstractCevice){
> > the problem is that the code cause a NPE on microemu and mpower sdk. since the
> > fix is mostly applicable to UEI device probably this is is the best way to do
> > the test
> > :)
> > gep
> 

Comment 8 Gustavo de Paula CLA 2008-10-15 09:24:18 EDT
all bugs we integrated and release on MTj 0.9