Actually I didn't touch the view activity at all... It was already possible to do that before. And what would happen is that gecko would offer the user the choice of all the apps that implement view for that mime type so he could use the app for view that he preferred. That would work also if the activity is invoked from gecko afaik.


On 04/06/2014, at 00:24, "David Flanagan" <notifications@github.com<mailto:notifications@github.com>> wrote:


In shared/js/download/download_ui.js:

> -    var fileName = DownloadFormatter.getFileName(download);
> -    var type = MimeMapper.guessTypeFromFileProperties(fileName,
> -                                                      download.contentType);
> -    if (type.length > 0) {
> -      if (type.startsWith('image/')) {
> -        actions.push(ACTIONS.WALLPAPER);
> -      } else if (type.startsWith('audio/')) {
> -        actions.push(ACTIONS.RINGTONE);
> +    // Mime types are tested against this table using startsWith, so if all
> +    // the subtypes of a given type have the same actions, just set type/ as
> +    // the key.
> +    var actionsByMimeType = {
> +      'application/vnd.oma.d': {
> +        actions: [ACTIONS.VIEW], // OMA DRM files must not be
> +                                 // shared
> +        default: ACTIONS.VIEW


I don't think you can do this. Any non-privleged app could implement the view activity for this mime type and get access to the unencrypted media, defeating the DRM.

The previous solution worked because the "view" activity was not really a normal activity but was invoked directly by gecko when the user clicked on an oma.drm link

In order to keep the content locked, the download manager should just stay out of the way and let the FL app do everything, or we should merge the FL app into the download manager app (which I don't want to do) or we need a private or certified-only communication channel between the download manager and the FL app.

—
Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/pull/19717/files#r13362736>.

________________________________

Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx