Bug 288549 - [fiximprove][SDK][api]: SDK provider device properties
Summary: [fiximprove][SDK][api]: SDK provider device properties
Status: ASSIGNED
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: SDK Management (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 1.0.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2009-09-03 15:47 EDT by Jon Dearden CLA
Modified: 2010-02-08 12:31 EST (History)
3 users (show)

See Also:


Attachments
Patch for MTJ bug 288549 (8.67 KB, patch)
2009-12-01 14:19 EST, Jon Dearden CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Dearden CLA 2009-09-03 15:47:09 EDT
User-Agent:       Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Build Identifier: 

Proposal for storing vendor-supplied data with device definitions:

Under Device Management, you can edit your device definitions. The stock fields include the description, location of the emulator and preverifier, the list of libraries, and a few other items. SDK providers supply emulators which have many and varied runtime settings and they will want to easily persist user preferences. This proposal is that we offer a standard mechanism for storing arbitrary vendor-defined properties in the device.xml file where MTJ stores its device settings. 

Associating SDK provider properties with a device means that they are persisted with the device and automatically disposed when a device is deleted. Without this capability, a vendor must:
   - locate an appropriate folder
   - persist the data
   - manage the lifecycle of their store file

The proposal is to add the following API methods to IMIDPDevice:

public Properties getSdkProviderProperties(String sdkId) 
    throws IllegalArgumentException;

public void setSdkProviderProperties(String sdkId, final Properties properties) throws IllegalArgumentException;

SDK provider properties will be stored in the devices.xml file as follows:
 
<device0 bundle="com.acompany.mtjtoolkit" class="com.acompany.mtjtoolkit.bigbadphone" id="0">
    ...
    <sdkProviderProperties>
        <sdk id=”com.acompany.mtjtoolkit”>
            <property name=”binDirectory” value = “c:\\ACompany\\BigBadPhone\\bin”/>
            <property name=”userSetting1” value = “true”/>
            <property name=”userSetting2” value = “42”/>
        </sdk>
    </sdkProviderProperties>
    ...
</device0>

There will be no restriction on how many 'sdk' elements that will be allowed under a 'sdkProviderProperties' element, though typically there will be only one. If this were not the case, then some other party could overwrite the one and only SDK provider section.


Reproducible: Always
Comment 1 Jon Dearden CLA 2009-10-13 15:20:24 EDT
Research In Motion will be making a contribution for this feature.

Cheers,
Jon Dearden
Comment 2 Jon Dearden CLA 2009-12-01 14:19:29 EST
Created attachment 153514 [details]
Patch for MTJ bug 288549

This patch adds the following methods to IDevice.java and AbstractMIDPDevice.java:

public void setSDKProvidedProperties(String sdkId, final Properties properties) 
            throws IllegalArgumentException;

public Properties getSDKProvidedProperties(String sdkId)
            throws IllegalArgumentException;

These methods allow arbitrary vendor-specific data to be associated with a device. This is useful for vendors who have user-adjustable emulator settings they would like to associate with different devices. These settings may be controlled via additional vendor-supplied device editor pages.
Comment 3 Jon Dearden CLA 2009-12-01 14:21:37 EST
I, Jon Dearden, have created the patch 153514 solely based on existing (EPL licensed) code in the MTJ project, and wrote 100% of the new code myself without using any other open source or proprietary source code as a basis for my work.

I am making my contribution available under the terms of the Eclipse Public License (EPL) to be included in the code base of the MTJ project.
Comment 4 Diego Madruga Sandin CLA 2010-02-08 12:31:28 EST
I'll revise this patch.