Closed Bug 1140523 Opened 9 years ago Closed 9 years ago

EME plugins don't send out correct onEnabling/onDisabling notifications when preferences change

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Iteration:
39.2 - 23 Mar
Tracking Status
firefox37 - disabled
firefox38 + fixed
firefox39 + fixed

People

(Reporter: mossop, Assigned: spohl)

References

Details

Attachments

(1 file, 1 obsolete file)

The code assumes that when one of the two prefs that control whether the plugin is enabled or not change then the plugins state must have changed when it may not have.
Flags: firefox-backlog+
[Tracking Requested - why for this release]:

My understanding is that EME is going to be enabled on some platforms in 37 so we should track this bug too. It will cause currently open add-ons manager windows to behave strangely if the user toggles one of the prefs from elsewhere (the global pref is apparently going to be in the Firefox UI somewhere).
EME will not ship in 37 so I'm not tracking for this release. Tracking for 38+ as 38 is the current target to ship EME.
Attached patch Patch (obsolete) — Splinter Review
I've tried to address this, but there are two situations that I'm not sure how to handle. When an EME GMP is both appDisabled and userDisabled and the user enables the global pref (appDisabled becomes false), or when the GMP is userDisabled and the user disables the global pref (appDisabled becomes true), then we currently don't send out any notification since the GMP is still disabled. However, the behavior in the addons manager is slightly different when we're appDisabled or userDisabled. In these scenarios here, we fail to make the "ask-to-activate/always-activate/never-activate" drop-down list selectable (if the GMP is only userDisabled) or unselectabe (if the GMP becomes appDisabled) if the addons manager is open at the same time as the pref is flipped. As soon as the addons manager is refreshed, the drop-down list appears properly. Instead of not sending out any notification, should I rather send out an onEnabled followed by an immediate onDisabled notification? Or is it better to keep it the way it is because the GMP never actually becomes enabled, just a different form of disabled?
Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Attachment #8577808 - Flags: review?(dtownsend)
Comment on attachment 8577808 [details] [diff] [review]
Patch

Review of attachment 8577808 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/mozapps/extensions/internal/GMPProvider.jsm
@@ +396,5 @@
>                                             "onEnabled" : "onDisabled",
>                                             this);
>    },
>  
> +  onPrefEMEGlobalEnabledChanged: function() {

Sending this notification here should cause the UI to update accordingly:

AddonManagerPrivate.callAddonListeners("onPropertyChanged", this, ["appDisabled"])
Attachment #8577808 - Flags: review?(dtownsend) → review+
Attached patch PatchSplinter Review
(In reply to Dave Townsend [:mossop] from comment #5)
> ::: toolkit/mozapps/extensions/internal/GMPProvider.jsm
> @@ +396,5 @@
> >                                             "onEnabled" : "onDisabled",
> >                                             this);
> >    },
> >  
> > +  onPrefEMEGlobalEnabledChanged: function() {
> 
> Sending this notification here should cause the UI to update accordingly:
> 
> AddonManagerPrivate.callAddonListeners("onPropertyChanged", this,
> ["appDisabled"])

That's it! Thanks, Dave! :-)

Updated patch, carrying over r+.
Attachment #8577808 - Attachment is obsolete: true
Attachment #8578160 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/a666d175b157
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Iteration: --- → 39.2 - 23 Mar
Flags: qe-verify?
I think this should basically be covered by regular EME testing, so setting as qe-verify-. Please set as qe-verify+ if you think any dedicated manual testing is needed here.
Flags: qe-verify? → qe-verify-
Comment on attachment 8578160 [details] [diff] [review]
Patch

Approval Request Comment
[Feature/regressing bug #]: Adobe EME
[User impact if declined]: EME plugins will not send out the proper onEnabling/onDisabling notifications in the addons manager UI when the user toggles the global EME pref, which can result in misleading UI (EME plugins may appear active when they aren't and vice-versa).
[Describe test coverage new/current, TreeHerder]: Local testing confirms that this is working properly. Has been on m-c since yesterday without any reported issues.
[Risks and why]: Limited to GMP and Adobe EME in particular.
[String/UUID change made/needed]: none.
Attachment #8578160 - Flags: approval-mozilla-aurora?
Comment on attachment 8578160 [details] [diff] [review]
Patch

EME matters, taking it.
Attachment #8578160 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: