diff --git a/mobile/android/modules/DownloadNotifications.jsm b/mobile/android/modules/DownloadNotifications.jsm index f67f52c866d..ee365461490 100644 --- a/mobile/android/modules/DownloadNotifications.jsm +++ b/mobile/android/modules/DownloadNotifications.jsm @@ -16,6 +16,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "Notifications", "resource://gre/modules XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); +XPCOMUtils.defineLazyServiceGetter(this, "ParentalControls", + "@mozilla.org/parental-controls-service;1", "nsIParentalControlsService"); + let Log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.i.bind(null, "DownloadNotifications"); XPCOMUtils.defineLazyGetter(this, "strings", @@ -58,6 +61,13 @@ var DownloadNotifications = { return; } + if (!ParentalControls.isAllowed(ParentalControls.DOWNLOAD)) { + download.cancel().catch(Cu.reportError); + download.removePartialData().catch(Cu.reportError); + window.NativeWindow.toast.show(strings.GetStringFromName("downloads.disabledInGuest"), "long"); + return; + } + let notification = new DownloadNotification(download); notifications.set(download, notification); notification.showOrUpdate();