I don't understand how this satisfies any requirements? I *think* the requirements are:
- Give a way for privileged callers to see apps that are "available" but not "installed" (where "installed" includes meaning natively installed) - Give a way for those callers to install an available app I'd suggest that getAll() be the only caller that gets available apps, and each app has an attribute app.installed. If false you may call app.install() to install the application locally (and you can monitor success with the install event). This presumes that you do the OS/WebRT check everytime someone calls getAll(), and for every app returned; hopefully that can be made efficient enough? (You can still cache results.) getInstalled and getSelf would not return available app objects, only installed apps. If we expect application installation can be pokey and error-prone (if it includes filling the app cache, then it could be) then we should have a "pending" install state, so a caller can determine that while the application isn't installed, there's no need to call app.install() again. And then there should probably also be some error state, so if the installation failed the reason can be stored somewhere. So maybe a more complete set of functionality would be app.installState = "available" | "installed" | "pending", app.installError = null | error object, and maybe app.oninstallstatechange and app.oninstallprogress. In the case of an error installError is saved (and I think should be saved permanently until there's another attempt to install) and the state reverts to "available" (then some sad face can be superimposed on the app). app.uninstall() reverts an application to available. app.install() takes no arguments, and both installs the app and its installData (receipts/etc) that the app was originally installed with. On Mon, Jun 18, 2012 at 5:00 PM, Anant Narayanan <[email protected]> wrote: > Hi all, > > jst and I had a brief chat on this topic today and have the following > proposal: > > - getInstalled retains its current behaviour when called from an origin > that is not privileged (e.g. an app store). > > - getInstalled, when called from a privileged origin, will return a list > of "natively" installed apps, where the natively-installed-or-not bit is > determined by the WebRT which takes into context the operating system and > other pertinent information. (In B2G, getAll and getInstalled will always > return the same set of apps, for instance). > > - getAll retains its current behaviour of returning all apps in the local > registry and can only be accessed from a privileged domain. > > As for re-purposing getInstalled to act differently when called from a > privileged domain, we should consider that every other API call in the > mozApps namespace with the exception of install is context-sensitive; and > the results vary based on who the caller is. This is therefore not a > departure from the rest of the API as currently defined. > > Please send any major objections to the list. If there are none, I propose > we move ahead with bug 749033 ASAP. > > Thanks, > > -Anant > > ______________________________**_________________ > dev-webapps mailing list > [email protected] > https://lists.mozilla.org/**listinfo/dev-webapps<https://lists.mozilla.org/listinfo/dev-webapps> > _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
