Bug 1125289 - (Part 1) Disallow installing add-ons and apps. r=ally
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 28 Jul 2015 13:40:37 +0200
changeset 255015 2b241cb3d78832537aca9d72c5b933dcdb55eff7
parent 255014 c5e15548e6c801d7e7850141cf01bb72fd7060bd
child 255016 d98c9b5082f1b1789a0b22c04448c8b69ea6eb88
push id29127
push userkwierso@gmail.com
push dateWed, 29 Jul 2015 00:53:00 +0000
treeherdermozilla-central@a828e099f0af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1125289
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1125289 - (Part 1) Disallow installing add-ons and apps. r=ally
mobile/android/base/RestrictedProfiles.java
mobile/android/base/locales/en-US/android_strings.dtd
mobile/android/base/strings.xml.in
--- a/mobile/android/base/RestrictedProfiles.java
+++ b/mobile/android/base/RestrictedProfiles.java
@@ -63,28 +63,28 @@ public class RestrictedProfiles {
     /* This is a list of things we can restrict you from doing. Some of these are reflected in Android UserManager constants.
      * Others are specific to us.
      * These constants should be in sync with the ones from toolkit/components/parentalcontrols/nsIParentalControlServices.idl
      */
     public enum Restriction {
         // These restrictions have no strings assigned because they are only used in guest mode and not shown in the
         // restricted profiles settings UI
         DISALLOW_DOWNLOADS(1, "no_download_files", 0, 0),
-        DISALLOW_INSTALL_EXTENSION(2, "no_install_extensions", 0, 0),
-        DISALLOW_INSTALL_APPS(3, "no_install_apps", 0, 0), // UserManager.DISALLOW_INSTALL_APPS
         DISALLOW_BROWSE_FILES(4, "no_browse_files", 0, 0),
         DISALLOW_SHARE(5, "no_share", 0, 0),
         DISALLOW_BOOKMARK(6, "no_bookmark", 0, 0),
         DISALLOW_ADD_CONTACTS(7, "no_add_contacts", 0, 0),
         DISALLOW_SET_IMAGE(8, "no_set_image", 0, 0),
         DISALLOW_MODIFY_ACCOUNTS(9, "no_modify_accounts", 0, 0), // UserManager.DISALLOW_MODIFY_ACCOUNTS
         DISALLOW_REMOTE_DEBUGGING(10, "no_remote_debugging", 0, 0),
 
         // These restrictions are used for restricted profiles and therefore need to have strings assigned for the profile
         // settings UI.
+        DISALLOW_INSTALL_EXTENSION(2, "no_install_extensions", R.string.restriction_disallow_addons_title, R.string.restriction_disallow_addons_description),
+        DISALLOW_INSTALL_APPS(3, "no_install_apps", R.string.restriction_disallow_apps_title, R.string.restriction_disallow_apps_description), // UserManager.DISALLOW_INSTALL_APPS
         DISALLOW_IMPORT_SETTINGS(11, "no_report_site_issue", R.string.restriction_disallow_import_settings_title, R.string.restriction_disallow_import_settings_description),
         DISALLOW_TOOLS_MENU(12, "no_tools_menu", R.string.restriction_disallow_tools_menu_title, R.string.restriction_disallow_tools_menu_description),
         DISALLOW_REPORT_SITE_ISSUE(13, "no_report_site_issue", R.string.restriction_disallow_report_site_issue_title, R.string.restriction_disallow_report_site_issue_description);
 
         public final int id;
         public final String name;
         public final int titleResource;
         public final int descriptionResource;
@@ -124,16 +124,18 @@ public class RestrictedProfiles {
         Restriction.DISALLOW_SET_IMAGE,
         Restriction.DISALLOW_MODIFY_ACCOUNTS,
         Restriction.DISALLOW_REMOTE_DEBUGGING,
         Restriction.DISALLOW_IMPORT_SETTINGS
     );
 
     // Restricted profiles will automatically have these restrictions by default
     static List<Restriction> RESTRICTED_PROFILE_RESTRICTIONS = Arrays.asList(
+        Restriction.DISALLOW_INSTALL_EXTENSION,
+        Restriction.DISALLOW_INSTALL_APPS,
         Restriction.DISALLOW_TOOLS_MENU,
         Restriction.DISALLOW_REPORT_SITE_ISSUE,
         Restriction.DISALLOW_IMPORT_SETTINGS
     );
 
     private static Restriction geckoActionToRestriction(int action) {
         for (Restriction rest : Restriction.values()) {
             if (rest.id == action) {
--- a/mobile/android/base/locales/en-US/android_strings.dtd
+++ b/mobile/android/base/locales/en-US/android_strings.dtd
@@ -683,10 +683,13 @@ just addresses the organization to follo
 <!-- Localization note: These are restrictions the device owner (e.g. parent) can enable for
      a restricted profile (e.g. child). Used inside the Android settings UI. -->
 <!ENTITY restriction_disallow_tools_menu_title "Disallow Tools menu">
 <!ENTITY restriction_disallow_tools_menu_description "Hide Tools menu from UI.">
 <!ENTITY restriction_disallow_report_site_issue_title "Disallow \'Report site issue\'">
 <!ENTITY restriction_disallow_report_site_issue_description "Hide \'Report site issue\' menu item.">
 <!ENTITY restriction_disallow_import_settings_title "Disallow importing settings">
 <!ENTITY restriction_disallow_import_settings_description "Do not allow to import settings from other system browsers.">
+<!ENTITY restriction_disallow_addons_title "Disallow add-ons">
+<!ENTITY restriction_disallow_addons_description "Disallow installation of add-ons.">
+<!ENTITY restriction_disallow_apps_title "Disallow apps">
+<!ENTITY restriction_disallow_apps_description "Disallow installing apps from Firefox Marketplace.">
 
-
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -543,16 +543,20 @@
 
   <!-- Restrictions -->
   <string name="restriction_disallow_tools_menu_title">&restriction_disallow_tools_menu_title;</string>
   <string name="restriction_disallow_tools_menu_description">&restriction_disallow_tools_menu_description;</string>
   <string name="restriction_disallow_report_site_issue_title">&restriction_disallow_report_site_issue_title;</string>
   <string name="restriction_disallow_report_site_issue_description">&restriction_disallow_report_site_issue_description;</string>
   <string name="restriction_disallow_import_settings_title">&restriction_disallow_import_settings_title;</string>
   <string name="restriction_disallow_import_settings_description">&restriction_disallow_import_settings_description;</string>
+  <string name="restriction_disallow_addons_title">&restriction_disallow_addons_title;</string>
+  <string name="restriction_disallow_addons_description">&restriction_disallow_addons_description;</string>
+  <string name="restriction_disallow_apps_title">&restriction_disallow_apps_title;</string>
+  <string name="restriction_disallow_apps_description">&restriction_disallow_apps_description;</string>
 
   <!-- Miscellaneous -->
   <string name="ellipsis">&ellipsis;</string>
 
   <string name="colon">&colon;</string>
 
   <string name="percent">&percent;</string>