Bug 1189336 - (Part 2) Rename Restriction class to Restrictable. r=ally
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 11 Nov 2015 16:39:28 +0100
changeset 274482 82cd040777655c08b79aca030a9bd885c8fd9d88
parent 274481 c52cc48aea1ea85a331012dfecf7f9cc837b7136
child 274483 6d38b37d27a44859fcda808e8c7f17980da88376
push id29733
push usercbook@mozilla.com
push dateMon, 30 Nov 2015 12:16:19 +0000
treeherdermozilla-central@2d385f1302a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1189336
milestone45.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 1189336 - (Part 2) Rename Restriction class to Restrictable. r=ally This is the first step to move from a list of DISALLOW_* things to a list of features that can be enabled or disabled for a profile. At a later stage we will check whether a "restrictable" feature is allowed or not.
mobile/android/base/AccountsHelper.java
mobile/android/base/BrowserApp.java
mobile/android/base/Restrictions.java
mobile/android/base/home/HistoryPanel.java
mobile/android/base/home/HomeConfigPrefsBackend.java
mobile/android/base/home/HomeFragment.java
mobile/android/base/home/TopSitesPanel.java
mobile/android/base/moz.build
mobile/android/base/preferences/AndroidImportPreference.java
mobile/android/base/preferences/GeckoPreferences.java
mobile/android/base/restrictions/DefaultConfiguration.java
mobile/android/base/restrictions/GuestProfileConfiguration.java
mobile/android/base/restrictions/Restrictable.java
mobile/android/base/restrictions/RestrictedProfileConfiguration.java
mobile/android/base/restrictions/Restriction.java
mobile/android/base/restrictions/RestrictionConfiguration.java
mobile/android/base/restrictions/RestrictionProvider.java
mobile/android/base/tabs/TabsPanel.java
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testRestrictions.java
--- a/mobile/android/base/AccountsHelper.java
+++ b/mobile/android/base/AccountsHelper.java
@@ -17,17 +17,17 @@ import android.util.Log;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.mozilla.gecko.background.fxa.FxAccountUtils;
 import org.mozilla.gecko.fxa.FirefoxAccounts;
 import org.mozilla.gecko.fxa.FxAccountConstants;
 import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
 import org.mozilla.gecko.fxa.login.Engaged;
 import org.mozilla.gecko.fxa.login.State;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.sync.SyncConfiguration;
 import org.mozilla.gecko.sync.Utils;
 import org.mozilla.gecko.sync.setup.SyncAccounts;
 import org.mozilla.gecko.util.EventCallback;
 import org.mozilla.gecko.util.NativeEventListener;
 import org.mozilla.gecko.util.NativeJSObject;
 
 import java.io.IOException;
@@ -78,17 +78,17 @@ public class AccountsHelper implements N
                 "Accounts:DeleteFirefoxAccount",
                 "Accounts:Exist",
                 "Accounts:ProfileUpdated",
                 "Accounts:ShowSyncPreferences");
     }
 
     @Override
     public void handleMessage(String event, NativeJSObject message, final EventCallback callback) {
-        if (!Restrictions.isAllowed(mContext, Restriction.DISALLOW_MODIFY_ACCOUNTS)) {
+        if (!Restrictions.isAllowed(mContext, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
             // We register for messages in all contexts; we drop, with a log and an error to JavaScript,
             // when the profile is restricted.  It's better to return errors than silently ignore messages.
             Log.e(LOGTAG, "Profile is not allowed to modify accounts!  Ignoring event: " + event);
             if (callback != null) {
                 callback.sendError("Profile is not allowed to modify accounts!");
             }
             return;
         }
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -44,17 +44,17 @@ import org.mozilla.gecko.menu.GeckoMenu;
 import org.mozilla.gecko.menu.GeckoMenuItem;
 import org.mozilla.gecko.mozglue.ContextUtils;
 import org.mozilla.gecko.mozglue.ContextUtils.SafeIntent;
 import org.mozilla.gecko.overlays.ui.ShareDialog;
 import org.mozilla.gecko.preferences.ClearOnShutdownPref;
 import org.mozilla.gecko.preferences.GeckoPreferences;
 import org.mozilla.gecko.prompts.Prompt;
 import org.mozilla.gecko.prompts.PromptListItem;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.sync.repositories.android.FennecTabsRepository;
 import org.mozilla.gecko.tabqueue.TabQueueHelper;
 import org.mozilla.gecko.tabqueue.TabQueuePrompt;
 import org.mozilla.gecko.tabs.TabHistoryController;
 import org.mozilla.gecko.tabs.TabHistoryController.OnShowTabHistory;
 import org.mozilla.gecko.tabs.TabHistoryFragment;
 import org.mozilla.gecko.tabs.TabHistoryPage;
 import org.mozilla.gecko.tabs.TabsPanel;
@@ -1788,17 +1788,17 @@ public class BrowserApp extends GeckoApp
                                 getSupportFragmentManager().beginTransaction().disallowAddToBackStack().add(mpm, tag).commit();
                             }
                         } catch (Exception ex) {
                             Log.e(LOGTAG, "Error initializing media manager", ex);
                         }
                     }
                 }
 
-                if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED && Restrictions.isAllowed(this, Restriction.DISALLOW_LOCATION_SERVICE)) {
+                if (AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED && Restrictions.isAllowed(this, Restrictable.DISALLOW_LOCATION_SERVICE)) {
                     // Start (this acts as ping if started already) the stumbler lib; if the stumbler has queued data it will upload it.
                     // Stumbler operates on its own thread, and startup impact is further minimized by delaying work (such as upload) a few seconds.
                     // Avoid any potential startup CPU/thread contention by delaying the pref broadcast.
                     final long oneSecondInMillis = 1000;
                     ThreadUtils.getBackgroundHandler().postDelayed(new Runnable() {
                         @Override
                         public void run() {
                              GeckoPreferences.broadcastStumblerPref(BrowserApp.this);
@@ -3079,21 +3079,21 @@ public class BrowserApp extends GeckoApp
         if (AboutPages.isAboutReader(url)) {
             String urlFromReader = ReaderModeUtils.getUrlFromAboutReader(url);
             if (urlFromReader != null) {
                 url = urlFromReader;
             }
         }
 
         // Disable share menuitem for about:, chrome:, file:, and resource: URIs
-        final boolean shareVisible = Restrictions.isAllowed(this, Restriction.DISALLOW_SHARE);
+        final boolean shareVisible = Restrictions.isAllowed(this, Restrictable.DISALLOW_SHARE);
         share.setVisible(shareVisible);
         final boolean shareEnabled = StringUtils.isShareableUrl(url) && shareVisible;
         share.setEnabled(shareEnabled);
-        MenuUtils.safeSetEnabled(aMenu, R.id.downloads, Restrictions.isAllowed(this, Restriction.DISALLOW_DOWNLOADS));
+        MenuUtils.safeSetEnabled(aMenu, R.id.downloads, Restrictions.isAllowed(this, Restrictable.DISALLOW_DOWNLOADS));
 
         // NOTE: Use MenuUtils.safeSetEnabled because some actions might
         // be on the BrowserToolbar context menu.
         if (Versions.feature11Plus) {
             MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab));
         }
         MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds());
         MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearch());
@@ -3146,17 +3146,17 @@ public class BrowserApp extends GeckoApp
 
                             shareIntent.putExtra("share_screenshot_uri", Uri.parse(outFile.getPath()));
                         }
                     }
                 }
             }
         }
 
-        final boolean privateTabVisible = Restrictions.isAllowed(this, Restriction.DISALLOW_PRIVATE_BROWSING);
+        final boolean privateTabVisible = Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING);
         MenuUtils.safeSetVisible(aMenu, R.id.new_private_tab, privateTabVisible);
 
         // Disable PDF generation (save and print) for about:home and xul pages.
         boolean allowPDF = (!(isAboutHome(tab) ||
                                tab.getContentType().equals("application/vnd.mozilla.xul+xml") ||
                                tab.getContentType().startsWith("video/")));
         saveAsPDF.setEnabled(allowPDF);
         print.setEnabled(allowPDF);
@@ -3168,21 +3168,21 @@ public class BrowserApp extends GeckoApp
         charEncoding.setVisible(GeckoPreferences.getCharEncodingState());
 
         if (mProfile.inGuestMode()) {
             exitGuestMode.setVisible(true);
         } else {
             enterGuestMode.setVisible(true);
         }
 
-        if (!Restrictions.isAllowed(this, Restriction.DISALLOW_GUEST_BROWSING)) {
+        if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_GUEST_BROWSING)) {
             MenuUtils.safeSetVisible(aMenu, R.id.new_guest_session, false);
         }
 
-        if (!Restrictions.isAllowed(this, Restriction.DISALLOW_INSTALL_EXTENSION)) {
+        if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_INSTALL_EXTENSION)) {
             MenuUtils.safeSetVisible(aMenu, R.id.addons, false);
         }
 
         return true;
     }
 
     private int resolveBookmarkIconID(final boolean isBookmark) {
         if (isBookmark) {
--- a/mobile/android/base/Restrictions.java
+++ b/mobile/android/base/Restrictions.java
@@ -5,24 +5,23 @@
 
 package org.mozilla.gecko;
 
 import org.mozilla.gecko.annotation.RobocopTarget;
 import org.mozilla.gecko.annotation.WrapForJNI;
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.restrictions.DefaultConfiguration;
 import org.mozilla.gecko.restrictions.GuestProfileConfiguration;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.restrictions.RestrictedProfileConfiguration;
-import org.mozilla.gecko.restrictions.Restriction;
 import org.mozilla.gecko.restrictions.RestrictionConfiguration;
 
 import android.annotation.TargetApi;
 import android.content.Context;
 import android.os.Build;
-import android.os.Bundle;
 import android.os.UserManager;
 import android.util.Log;
 
 @RobocopTarget
 public class Restrictions {
     private static final String LOGTAG = "GeckoRestrictedProfiles";
 
     private static RestrictionConfiguration configuration;
@@ -78,18 +77,18 @@ public class Restrictions {
         final UserManager mgr = (UserManager) context.getSystemService(Context.USER_SERVICE);
         return !mgr.getApplicationRestrictions(context.getPackageName()).isEmpty();
     }
 
     public static void update(Context context) {
         getConfiguration(context).update();
     }
 
-    private static Restriction geckoActionToRestriction(int action) {
-        for (Restriction rest : Restriction.values()) {
+    private static Restrictable geckoActionToRestriction(int action) {
+        for (Restrictable rest : Restrictable.values()) {
             if (rest.id == action) {
                 return rest;
             }
         }
 
         throw new IllegalArgumentException("Unknown action " + action);
     }
 
@@ -101,33 +100,33 @@ public class Restrictions {
     public static boolean isUserRestricted() {
         return isUserRestricted(GeckoAppShell.getApplicationContext());
     }
 
     public static boolean isUserRestricted(final Context context) {
         return getConfiguration(context).isRestricted();
     }
 
-    public static boolean isAllowed(final Context context, final Restriction restriction) {
-        return getConfiguration(context).isAllowed(restriction);
+    public static boolean isAllowed(final Context context, final Restrictable restrictable) {
+        return getConfiguration(context).isAllowed(restrictable);
     }
 
     @WrapForJNI
     public static boolean isAllowed(int action, String url) {
-        final Restriction restriction;
+        final Restrictable restrictable;
         try {
-            restriction = geckoActionToRestriction(action);
+            restrictable = geckoActionToRestriction(action);
         } catch (IllegalArgumentException ex) {
             // Unknown actions represent a coding error, so we
             // refuse the action and log.
             Log.e(LOGTAG, "Unknown action " + action + "; check calling code.");
             return false;
         }
 
         final Context context = GeckoAppShell.getApplicationContext();
 
-        if (Restriction.DISALLOW_BROWSE_FILES == restriction) {
+        if (Restrictable.DISALLOW_BROWSE_FILES == restrictable) {
             return canLoadUrl(context, url);
         } else {
-            return isAllowed(context, restriction);
+            return isAllowed(context, restrictable);
         }
     }
 }
--- a/mobile/android/base/home/HistoryPanel.java
+++ b/mobile/android/base/home/HistoryPanel.java
@@ -21,17 +21,17 @@ import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Restrictions;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.db.BrowserContract.Combined;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.home.HomeContextMenuInfo.RemoveItemType;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.util.ColorUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import android.app.AlertDialog;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.database.Cursor;
@@ -219,17 +219,17 @@ public class HistoryPanel extends HomeFr
             }
         });
     }
 
     @Override
     public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) {
         super.onCreateContextMenu(menu, view, menuInfo);
 
-        if (!Restrictions.isAllowed(getActivity(), Restriction.DISALLOW_CLEAR_HISTORY)) {
+        if (!Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
             menu.findItem(R.id.home_remove).setVisible(false);
         }
     }
 
     @Override
     public void onDestroyView() {
         super.onDestroyView();
 
@@ -286,17 +286,17 @@ public class HistoryPanel extends HomeFr
 
     @Override
     protected void load() {
         getLoaderManager().initLoader(LOADER_ID_HISTORY, null, mCursorLoaderCallbacks);
     }
 
     private void updateUiFromCursor(Cursor c) {
         if (c != null && c.getCount() > 0) {
-            if (Restrictions.isAllowed(getActivity(), Restriction.DISALLOW_CLEAR_HISTORY)) {
+            if (Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
                 mClearHistoryButton.setVisibility(View.VISIBLE);
             }
             return;
         }
 
         // Cursor is empty, so hide the "Clear browsing history" button,
         // and set the empty view if it hasn't been set already.
         mClearHistoryButton.setVisibility(View.GONE);
@@ -317,17 +317,17 @@ public class HistoryPanel extends HomeFr
 
             final SpannableStringBuilder hintBuilder = formatHintText(hintText);
             if (hintBuilder != null) {
                 emptyHint.setText(hintBuilder);
                 emptyHint.setMovementMethod(LinkMovementMethod.getInstance());
                 emptyHint.setVisibility(View.VISIBLE);
             }
 
-            if (!Restrictions.isAllowed(getActivity(), Restriction.DISALLOW_PRIVATE_BROWSING)) {
+            if (!Restrictions.isAllowed(getActivity(), Restrictable.DISALLOW_PRIVATE_BROWSING)) {
                 emptyHint.setVisibility(View.GONE);
             }
 
             mList.setEmptyView(mEmptyView);
         }
     }
 
     /**
--- a/mobile/android/base/home/HomeConfigPrefsBackend.java
+++ b/mobile/android/base/home/HomeConfigPrefsBackend.java
@@ -16,17 +16,17 @@ import org.json.JSONException;
 import org.json.JSONObject;
 import org.mozilla.gecko.GeckoSharedPrefs;
 import org.mozilla.gecko.Restrictions;
 import org.mozilla.gecko.home.HomeConfig.HomeConfigBackend;
 import org.mozilla.gecko.home.HomeConfig.OnReloadListener;
 import org.mozilla.gecko.home.HomeConfig.PanelConfig;
 import org.mozilla.gecko.home.HomeConfig.PanelType;
 import org.mozilla.gecko.home.HomeConfig.State;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.util.HardwareUtils;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
 import android.support.v4.content.LocalBroadcastManager;
@@ -72,17 +72,17 @@ class HomeConfigPrefsBackend implements 
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.TOP_SITES,
                                                   EnumSet.of(PanelConfig.Flags.DEFAULT_PANEL)));
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.BOOKMARKS));
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.HISTORY));
 
         // We disable Synced Tabs for guest mode / restricted profiles.
-        if (Restrictions.isAllowed(mContext, Restriction.DISALLOW_MODIFY_ACCOUNTS)) {
+        if (Restrictions.isAllowed(mContext, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
             panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.REMOTE_TABS));
         }
 
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.RECENT_TABS));
         panelConfigs.add(createBuiltinPanelConfig(mContext, PanelType.READING_LIST));
 
         return new State(panelConfigs, true);
     }
--- a/mobile/android/base/home/HomeFragment.java
+++ b/mobile/android/base/home/HomeFragment.java
@@ -18,17 +18,17 @@ import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
 import org.mozilla.gecko.favicons.Favicons;
 import org.mozilla.gecko.home.HomeContextMenuInfo.RemoveItemType;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenInBackgroundListener;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
 import org.mozilla.gecko.home.TopSitesGridView.TopSitesGridContextMenuInfo;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.util.Clipboard;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.util.UIAsyncTask;
 
 import android.app.Activity;
 import android.content.ContentResolver;
 import android.content.Context;
@@ -148,17 +148,17 @@ public abstract class HomeFragment exten
         if (!info.canRemove()) {
             menu.findItem(R.id.home_remove).setVisible(false);
         }
 
         if (!StringUtils.isShareableUrl(info.url) || GeckoProfile.get(getActivity()).inGuestMode()) {
             menu.findItem(R.id.home_share).setVisible(false);
         }
 
-        if (!Restrictions.isAllowed(view.getContext(), Restriction.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(view.getContext(), Restrictable.DISALLOW_PRIVATE_BROWSING)) {
             menu.findItem(R.id.home_open_private_tab).setVisible(false);
         }
 
         menu.findItem(R.id.mark_read).setVisible(info.isInReadingList() && info.isUnread);
         menu.findItem(R.id.mark_unread).setVisible(info.isInReadingList() && !info.isUnread);
     }
 
     @Override
--- a/mobile/android/base/home/TopSitesPanel.java
+++ b/mobile/android/base/home/TopSitesPanel.java
@@ -29,17 +29,17 @@ import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.favicons.Favicons;
 import org.mozilla.gecko.favicons.OnFaviconLoadedListener;
 import org.mozilla.gecko.gfx.BitmapUtils;
 import org.mozilla.gecko.home.HomeContextMenuInfo.RemoveItemType;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
 import org.mozilla.gecko.home.PinSiteDialog.OnSiteSelectedListener;
 import org.mozilla.gecko.home.TopSitesGridView.OnEditPinnedSiteListener;
 import org.mozilla.gecko.home.TopSitesGridView.TopSitesGridContextMenuInfo;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.tiles.TilesRecorder;
 import org.mozilla.gecko.tiles.Tile;
 import org.mozilla.gecko.util.StringUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import android.app.Activity;
 import android.content.ContentResolver;
 import android.content.Context;
@@ -338,33 +338,33 @@ public class TopSitesPanel extends HomeF
             return;
         }
 
         if (!(menuInfo instanceof TopSitesGridContextMenuInfo)) {
             // Long pressed item was not a Top Sites GridView item. Superclass
             // can handle this.
             super.onCreateContextMenu(menu, view, menuInfo);
 
-            if (!Restrictions.isAllowed(view.getContext(), Restriction.DISALLOW_CLEAR_HISTORY)) {
+            if (!Restrictions.isAllowed(view.getContext(), Restrictable.DISALLOW_CLEAR_HISTORY)) {
                 menu.findItem(R.id.home_remove).setVisible(false);
             }
 
             return;
         }
 
         final Context context = view.getContext();
 
         // Long pressed item was a Top Sites GridView item, handle it.
         MenuInflater inflater = new MenuInflater(context);
         inflater.inflate(R.menu.home_contextmenu, menu);
 
         // Hide unused menu items.
         menu.findItem(R.id.home_edit_bookmark).setVisible(false);
 
-        menu.findItem(R.id.home_remove).setVisible(Restrictions.isAllowed(context, Restriction.DISALLOW_CLEAR_HISTORY));
+        menu.findItem(R.id.home_remove).setVisible(Restrictions.isAllowed(context, Restrictable.DISALLOW_CLEAR_HISTORY));
 
         TopSitesGridContextMenuInfo info = (TopSitesGridContextMenuInfo) menuInfo;
         menu.setHeaderTitle(info.getDisplayTitle());
 
         if (info.type != TopSites.TYPE_BLANK) {
             if (info.type == TopSites.TYPE_PINNED) {
                 menu.findItem(R.id.top_sites_pin).setVisible(false);
             } else {
@@ -376,17 +376,17 @@ public class TopSitesPanel extends HomeF
             menu.findItem(R.id.top_sites_pin).setVisible(false);
             menu.findItem(R.id.top_sites_unpin).setVisible(false);
         }
 
         if (!StringUtils.isShareableUrl(info.url) || GeckoProfile.get(getActivity()).inGuestMode()) {
             menu.findItem(R.id.home_share).setVisible(false);
         }
 
-        if (!Restrictions.isAllowed(context, Restriction.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(context, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
             menu.findItem(R.id.home_open_private_tab).setVisible(false);
         }
 
         // We only show these menu items on the reading list panel:
         menu.findItem(R.id.mark_read).setVisible(false);
         menu.findItem(R.id.mark_unread).setVisible(false);
     }
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -476,18 +476,18 @@ gbjar.sources += [
     'ReaderModeUtils.java',
     'ReadingListHelper.java',
     'RemoteClientsDialogFragment.java',
     'RemoteTabsExpandableListAdapter.java',
     'Restarter.java',
     'Restrictions.java',
     'restrictions/DefaultConfiguration.java',
     'restrictions/GuestProfileConfiguration.java',
+    'restrictions/Restrictable.java',
     'restrictions/RestrictedProfileConfiguration.java',
-    'restrictions/Restriction.java',
     'restrictions/RestrictionConfiguration.java',
     'restrictions/RestrictionProvider.java',
     'ServiceNotificationClient.java',
     'SessionParser.java',
     'SharedPreferencesHelper.java',
     'SiteIdentity.java',
     'SmsManager.java',
     'sqlite/ByteBufferInputStream.java',
--- a/mobile/android/base/preferences/AndroidImportPreference.java
+++ b/mobile/android/base/preferences/AndroidImportPreference.java
@@ -2,19 +2,19 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.preferences;
 
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.Restrictions;
-import org.mozilla.gecko.restrictions.Restriction;
 
 import java.util.Set;
 
 import android.app.ProgressDialog;
 import android.content.Context;
 import android.preference.Preference;
 import android.util.AttributeSet;
 import android.util.Log;
@@ -23,17 +23,17 @@ class AndroidImportPreference extends Mu
     private static final String LOGTAG = "AndroidImport";
     public static final String PREF_KEY = "android.not_a_preference.import_android";
     private static final String PREF_KEY_PREFIX = "import_android.data.";
     private final Context mContext;
 
     public static class Handler implements GeckoPreferences.PrefHandler {
         public boolean setupPref(Context context, Preference pref) {
             // Feature disabled on devices running Android M+ (Bug 1183559)
-            return Versions.preM && Restrictions.isAllowed(context, Restriction.DISALLOW_IMPORT_SETTINGS);
+            return Versions.preM && Restrictions.isAllowed(context, Restrictable.DISALLOW_IMPORT_SETTINGS);
         }
 
         public void onChange(Context context, Preference pref, Object newValue) { }
     }
 
     public AndroidImportPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
--- a/mobile/android/base/preferences/GeckoPreferences.java
+++ b/mobile/android/base/preferences/GeckoPreferences.java
@@ -25,17 +25,17 @@ import org.mozilla.gecko.PrefsHelper;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Restrictions;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.TelemetryContract.Method;
 import org.mozilla.gecko.background.common.GlobalConstants;
 import org.mozilla.gecko.background.healthreport.HealthReportConstants;
 import org.mozilla.gecko.db.BrowserContract.SuggestedSites;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.tabqueue.TabQueueHelper;
 import org.mozilla.gecko.updater.UpdateService;
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.InputOptionsUtils;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.widget.FloatingHintEditText;
@@ -458,17 +458,17 @@ OnSharedPreferenceChangeListener
         if (onIsMultiPane()) {
             loadHeadersFromResource(R.xml.preference_headers, target);
 
             Iterator<Header> iterator = target.iterator();
 
             while (iterator.hasNext()) {
                 Header header = iterator.next();
 
-                if (header.id == R.id.pref_header_advanced && !Restrictions.isAllowed(this, Restriction.DISALLOW_ADVANCED_SETTINGS)) {
+                if (header.id == R.id.pref_header_advanced && !Restrictions.isAllowed(this, Restrictable.DISALLOW_ADVANCED_SETTINGS)) {
                     iterator.remove();
                 }
             }
 
             mHeaders = target;
         }
     }
 
@@ -673,33 +673,33 @@ OnSharedPreferenceChangeListener
                 // If datareporting is disabled, remove UI.
                 if (PREFS_DATA_REPORTING_PREFERENCES.equals(key)) {
                     if (!AppConstants.MOZ_DATA_REPORTING) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_SCREEN_ADVANCED.equals(key) &&
-                        !Restrictions.isAllowed(this, Restriction.DISALLOW_ADVANCED_SETTINGS)) {
+                        !Restrictions.isAllowed(this, Restrictable.DISALLOW_ADVANCED_SETTINGS)) {
                     preferences.removePreference(pref);
                     i--;
                     continue;
                 }
                 setupPreferences((PreferenceGroup) pref, prefs);
             } else {
                 pref.setOnPreferenceChangeListener(this);
                 if (PREFS_UPDATER_AUTODOWNLOAD.equals(key)) {
                     if (!AppConstants.MOZ_UPDATER) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_OPEN_URLS_IN_PRIVATE.equals(key)) {
                     // Remove UI for opening external links in private browsing on non-Nightly builds.
-                    if (!AppConstants.NIGHTLY_BUILD || !Restrictions.isAllowed(this, Restriction.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!AppConstants.NIGHTLY_BUILD || !Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION.equals(key)) {
                     // Remove UI for global TP pref in non-Nightly builds.
                     if (!AppConstants.NIGHTLY_BUILD) {
                         preferences.removePreference(pref);
@@ -729,59 +729,59 @@ OnSharedPreferenceChangeListener
                 } else if (PREFS_CRASHREPORTER_ENABLED.equals(key)) {
                     if (!AppConstants.MOZ_CRASHREPORTER) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_GEO_REPORTING.equals(key) ||
                            PREFS_GEO_LEARN_MORE.equals(key)) {
-                    if (!AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED || !Restrictions.isAllowed(this, Restriction.DISALLOW_LOCATION_SERVICE)) {
+                    if (!AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED || !Restrictions.isAllowed(this, Restrictable.DISALLOW_LOCATION_SERVICE)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_USB_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_WIFI_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                     if (!InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         // WiFi debugging requires a QR code reader
                         pref.setEnabled(false);
                         pref.setSummary(getString(R.string.pref_developer_remotedebugging_wifi_disabled_summary));
                         continue;
                     }
                 } else if (PREFS_DEVTOOLS_REMOTE_LINK.equals(key)) {
                     // Remove the "Learn more" link if remote debugging is disabled
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_REMOTE_DEBUGGING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_REMOTE_DEBUGGING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_RESTORE_SESSION.equals(key) ||
                            PREFS_BROWSER_LOCALE.equals(key)) {
                     // Set the summary string to the current entry. The summary
                     // for other list prefs will be set in the PrefsHelper
                     // callback, but since this pref doesn't live in Gecko, we
                     // need to handle it separately.
                     ListPreference listPref = (ListPreference) pref;
                     CharSequence selectedEntry = listPref.getEntry();
                     listPref.setSummary(selectedEntry);
                     continue;
                 } else if (PREFS_SYNC.equals(key)) {
                     // Don't show sync prefs while in guest mode.
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_MODIFY_ACCOUNTS)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_MODIFY_ACCOUNTS)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_SEARCH_RESTORE_DEFAULTS.equals(key)) {
                     pref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
                         @Override
                         public boolean onPreferenceClick(Preference preference) {
@@ -814,41 +814,41 @@ OnSharedPreferenceChangeListener
                 } else if (PREFS_QRCODE_ENABLED.equals(key)) {
                     if (!InputOptionsUtils.supportsQrCodeReader(getApplicationContext())) {
                         // Remove UI for qr code input on non nightly builds
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION_PRIVATE_BROWSING.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_TRACKING_PROTECTION_LEARN_MORE.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_PRIVATE_BROWSING)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_MP_ENABLED.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_MASTER_PASSWORD)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_MASTER_PASSWORD)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_CUSTOMIZE_IMAGE_BLOCKING.equals(key)) {
                     if (!AppConstants.NIGHTLY_BUILD) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_CLEAR_PRIVATE_DATA.equals(key) || PREFS_CLEAR_PRIVATE_DATA_EXIT.equals(key)) {
-                    if (!Restrictions.isAllowed(this, Restriction.DISALLOW_CLEAR_HISTORY)) {
+                    if (!Restrictions.isAllowed(this, Restrictable.DISALLOW_CLEAR_HISTORY)) {
                         preferences.removePreference(pref);
                         i--;
                         continue;
                     }
                 } else if (PREFS_HOMEPAGE.equals(key)) {
                         String setUrl = GeckoSharedPrefs.forProfile(getBaseContext()).getString(PREFS_HOMEPAGE, AboutPages.HOME);
                         setHomePageSummary(pref, setUrl);
                         pref.setOnPreferenceChangeListener(this);
--- a/mobile/android/base/restrictions/DefaultConfiguration.java
+++ b/mobile/android/base/restrictions/DefaultConfiguration.java
@@ -6,17 +6,17 @@
 package org.mozilla.gecko.restrictions;
 
 /**
  * Default implementation of RestrictionConfiguration interface. Used whenever no restrictions are enforced for the
  * current profile.
  */
 public class DefaultConfiguration implements RestrictionConfiguration {
     @Override
-    public boolean isAllowed(Restriction restriction) {
+    public boolean isAllowed(Restrictable restrictable) {
         return true;
     }
 
     @Override
     public boolean canLoadUrl(String url) {
         return true;
     }
 
--- a/mobile/android/base/restrictions/GuestProfileConfiguration.java
+++ b/mobile/android/base/restrictions/GuestProfileConfiguration.java
@@ -9,28 +9,28 @@ import android.net.Uri;
 
 import java.util.Arrays;
 import java.util.List;
 
 /**
  * RestrictionConfiguration implementation for guest profiles.
  */
 public class GuestProfileConfiguration implements RestrictionConfiguration {
-    static List<Restriction> DEFAULT_RESTRICTIONS = Arrays.asList(
-            Restriction.DISALLOW_DOWNLOADS,
-            Restriction.DISALLOW_INSTALL_EXTENSION,
-            Restriction.DISALLOW_INSTALL_APPS,
-            Restriction.DISALLOW_BROWSE_FILES,
-            Restriction.DISALLOW_SHARE,
-            Restriction.DISALLOW_BOOKMARK,
-            Restriction.DISALLOW_ADD_CONTACTS,
-            Restriction.DISALLOW_SET_IMAGE,
-            Restriction.DISALLOW_MODIFY_ACCOUNTS,
-            Restriction.DISALLOW_REMOTE_DEBUGGING,
-            Restriction.DISALLOW_IMPORT_SETTINGS
+    static List<Restrictable> DEFAULT_RESTRICTIONS = Arrays.asList(
+            Restrictable.DISALLOW_DOWNLOADS,
+            Restrictable.DISALLOW_INSTALL_EXTENSION,
+            Restrictable.DISALLOW_INSTALL_APPS,
+            Restrictable.DISALLOW_BROWSE_FILES,
+            Restrictable.DISALLOW_SHARE,
+            Restrictable.DISALLOW_BOOKMARK,
+            Restrictable.DISALLOW_ADD_CONTACTS,
+            Restrictable.DISALLOW_SET_IMAGE,
+            Restrictable.DISALLOW_MODIFY_ACCOUNTS,
+            Restrictable.DISALLOW_REMOTE_DEBUGGING,
+            Restrictable.DISALLOW_IMPORT_SETTINGS
     );
 
     @SuppressWarnings("serial")
     private static final List<String> BANNED_SCHEMES = Arrays.asList(
             "file",
             "chrome",
             "resource",
             "jar",
@@ -38,18 +38,18 @@ public class GuestProfileConfiguration i
     );
 
     private static final List<String> BANNED_URLS = Arrays.asList(
             "about:config",
             "about:addons"
     );
 
     @Override
-    public boolean isAllowed(Restriction restriction) {
-        return !DEFAULT_RESTRICTIONS.contains(restriction);
+    public boolean isAllowed(Restrictable restrictable) {
+        return !DEFAULT_RESTRICTIONS.contains(restrictable);
     }
 
     @Override
     public boolean canLoadUrl(String url) {
         // Null URLs are always permitted.
         if (url == null) {
             return true;
         }
rename from mobile/android/base/restrictions/Restriction.java
rename to mobile/android/base/restrictions/Restrictable.java
--- a/mobile/android/base/restrictions/Restriction.java
+++ b/mobile/android/base/restrictions/Restrictable.java
@@ -10,17 +10,17 @@ import org.mozilla.gecko.R;
 import android.content.Context;
 import android.support.annotation.StringRes;
 
 /**
  * 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/nsIParentalControlsService.idl
  */
-public enum Restriction {
+public enum Restrictable {
     DISALLOW_DOWNLOADS(1, "no_download_files", 0),
 
     DISALLOW_INSTALL_EXTENSION(2, "no_install_extensions", R.string.restriction_disallow_addons_title),
 
     // UserManager.DISALLOW_INSTALL_APPS
     DISALLOW_INSTALL_APPS(3, "no_install_apps", 0),
 
     DISALLOW_BROWSE_FILES(4, "no_browse_files", 0),
@@ -55,17 +55,17 @@ public enum Restriction {
     DISALLOW_CAMERA_MICROPHONE(18, "no_camera_microphone", R.string.restriction_disallow_camera_microphone_title);
 
     public final int id;
     public final String name;
 
     @StringRes
     public final int title;
 
-    Restriction(final int id, final String name, @StringRes int title) {
+    Restrictable(final int id, final String name, @StringRes int title) {
         this.id = id;
         this.name = name;
         this.title = title;
     }
 
     public String getTitle(Context context) {
         if (title == 0) {
             return toString();
--- a/mobile/android/base/restrictions/RestrictedProfileConfiguration.java
+++ b/mobile/android/base/restrictions/RestrictedProfileConfiguration.java
@@ -15,43 +15,43 @@ import android.os.Bundle;
 import android.os.StrictMode;
 import android.os.UserManager;
 
 import java.util.Arrays;
 import java.util.List;
 
 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
 public class RestrictedProfileConfiguration implements RestrictionConfiguration {
-    static List<Restriction> DEFAULT_RESTRICTIONS = Arrays.asList(
-            Restriction.DISALLOW_INSTALL_EXTENSION,
-            Restriction.DISALLOW_PRIVATE_BROWSING,
-            Restriction.DISALLOW_LOCATION_SERVICE,
-            Restriction.DISALLOW_CLEAR_HISTORY,
-            Restriction.DISALLOW_MASTER_PASSWORD,
-            Restriction.DISALLOW_GUEST_BROWSING,
-            Restriction.DISALLOW_ADVANCED_SETTINGS,
-            Restriction.DISALLOW_CAMERA_MICROPHONE
+    static List<Restrictable> DEFAULT_RESTRICTIONS = Arrays.asList(
+            Restrictable.DISALLOW_INSTALL_EXTENSION,
+            Restrictable.DISALLOW_PRIVATE_BROWSING,
+            Restrictable.DISALLOW_LOCATION_SERVICE,
+            Restrictable.DISALLOW_CLEAR_HISTORY,
+            Restrictable.DISALLOW_MASTER_PASSWORD,
+            Restrictable.DISALLOW_GUEST_BROWSING,
+            Restrictable.DISALLOW_ADVANCED_SETTINGS,
+            Restrictable.DISALLOW_CAMERA_MICROPHONE
     );
 
     private Context context;
     private Bundle cachedRestrictions;
     private boolean isCacheInvalid = true;
 
     public RestrictedProfileConfiguration(Context context) {
         this.context = context.getApplicationContext();
     }
 
     @Override
-    public synchronized boolean isAllowed(Restriction restriction) {
+    public synchronized boolean isAllowed(Restrictable restrictable) {
         if (isCacheInvalid || !ThreadUtils.isOnUiThread()) {
             cachedRestrictions = readRestrictions();
             isCacheInvalid = false;
         }
 
-        return !cachedRestrictions.getBoolean(restriction.name, DEFAULT_RESTRICTIONS.contains(restriction));
+        return !cachedRestrictions.getBoolean(restrictable.name, DEFAULT_RESTRICTIONS.contains(restrictable));
     }
 
     private Bundle readRestrictions() {
         final UserManager mgr = (UserManager) context.getSystemService(Context.USER_SERVICE);
 
         StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads();
 
         try {
@@ -61,21 +61,21 @@ public class RestrictedProfileConfigurat
             return restrictions;
         } finally {
             StrictMode.setThreadPolicy(policy);
         }
     }
 
     @Override
     public boolean canLoadUrl(String url) {
-        if (!isAllowed(Restriction.DISALLOW_INSTALL_EXTENSION) && AboutPages.isAboutAddons(url)) {
+        if (!isAllowed(Restrictable.DISALLOW_INSTALL_EXTENSION) && AboutPages.isAboutAddons(url)) {
             return false;
         }
 
-        if (!isAllowed(Restriction.DISALLOW_PRIVATE_BROWSING) && AboutPages.isAboutPrivateBrowsing(url)) {
+        if (!isAllowed(Restrictable.DISALLOW_PRIVATE_BROWSING) && AboutPages.isAboutPrivateBrowsing(url)) {
             return false;
         }
 
         if (AboutPages.isAboutConfig(url)) {
             // Always block access to about:config to prevent circumventing restrictions (Bug 1189233)
             return false;
         }
 
--- a/mobile/android/base/restrictions/RestrictionConfiguration.java
+++ b/mobile/android/base/restrictions/RestrictionConfiguration.java
@@ -7,17 +7,17 @@ package org.mozilla.gecko.restrictions;
 
 /**
  * Interface for classes that Restrictions will delegate to for making decisions.
  */
 public interface RestrictionConfiguration {
     /**
      * Is the user allowed to perform this action?
      */
-    boolean isAllowed(Restriction restriction);
+    boolean isAllowed(Restrictable restrictable);
 
     /**
      * Is the user allowed to load the given URL?
      */
     boolean canLoadUrl(String url);
 
     /**
      * Is this user restricted in any way?
--- a/mobile/android/base/restrictions/RestrictionProvider.java
+++ b/mobile/android/base/restrictions/RestrictionProvider.java
@@ -1,19 +1,16 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.restrictions;
 
 import org.mozilla.gecko.AppConstants;
-import org.mozilla.gecko.restrictions.RestrictedProfileConfiguration;
-import org.mozilla.gecko.restrictions.Restriction;
-import org.mozilla.gecko.sync.setup.Constants;
 
 import android.annotation.TargetApi;
 import android.app.Activity;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.RestrictionEntry;
 import android.os.Build;
@@ -48,29 +45,29 @@ public class RestrictionProvider extends
                 result.finish();
             }
         }.start();
     }
 
     private ArrayList<RestrictionEntry> initRestrictions(Context context, Bundle oldRestrictions) {
         ArrayList<RestrictionEntry> entries = new ArrayList<RestrictionEntry>();
 
-        for (Restriction restriction : RestrictedProfileConfiguration.DEFAULT_RESTRICTIONS) {
-            if (restriction == Restriction.DISALLOW_LOCATION_SERVICE && !AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
+        for (Restrictable restrictable : RestrictedProfileConfiguration.DEFAULT_RESTRICTIONS) {
+            if (restrictable == Restrictable.DISALLOW_LOCATION_SERVICE && !AppConstants.MOZ_STUMBLER_BUILD_TIME_ENABLED) {
                 continue;
             }
 
-            RestrictionEntry entry = createRestrictionEntryWithDefaultValue(context, restriction,
-                    oldRestrictions.getBoolean(restriction.name, true));
+            RestrictionEntry entry = createRestrictionEntryWithDefaultValue(context, restrictable,
+                    oldRestrictions.getBoolean(restrictable.name, true));
             entries.add(entry);
         }
 
         return entries;
     }
 
-    private RestrictionEntry createRestrictionEntryWithDefaultValue(Context context, Restriction restriction, boolean defaultValue) {
-        RestrictionEntry entry = new RestrictionEntry(restriction.name, defaultValue);
+    private RestrictionEntry createRestrictionEntryWithDefaultValue(Context context, Restrictable restrictable, boolean defaultValue) {
+        RestrictionEntry entry = new RestrictionEntry(restrictable.name, defaultValue);
 
-        entry.setTitle(restriction.getTitle(context));
+        entry.setTitle(restrictable.getTitle(context));
 
         return entry;
     }
 }
--- a/mobile/android/base/tabs/TabsPanel.java
+++ b/mobile/android/base/tabs/TabsPanel.java
@@ -11,17 +11,17 @@ import org.mozilla.gecko.GeckoApplicatio
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Restrictions;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.animation.PropertyAnimator;
 import org.mozilla.gecko.animation.ViewHelper;
 import org.mozilla.gecko.lwt.LightweightTheme;
 import org.mozilla.gecko.lwt.LightweightThemeDrawable;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.util.ColorUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.widget.GeckoPopupMenu;
 import org.mozilla.gecko.widget.IconTabWidget;
 
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -139,17 +139,17 @@ public class TabsPanel extends LinearLay
 
         mTabWidget = (IconTabWidget) findViewById(R.id.tab_widget);
 
         mTabWidget.addTab(R.drawable.tabs_normal, R.string.tabs_normal);
         final ThemedImageButton privateTabsPanel =
                 (ThemedImageButton) mTabWidget.addTab(R.drawable.tabs_private, R.string.tabs_private);
         privateTabsPanel.setPrivateMode(true);
 
-        if (!Restrictions.isAllowed(mContext, Restriction.DISALLOW_PRIVATE_BROWSING)) {
+        if (!Restrictions.isAllowed(mContext, Restrictable.DISALLOW_PRIVATE_BROWSING)) {
             mTabWidget.setVisibility(View.GONE);
         }
 
         mTabWidget.setTabSelectionListener(this);
 
         mMenuButton = findViewById(R.id.menu);
         mMenuButton.setOnClickListener(new Button.OnClickListener() {
             @Override
@@ -168,17 +168,17 @@ public class TabsPanel extends LinearLay
     }
 
     public void showMenu() {
         final Menu menu = mPopupMenu.getMenu();
 
         // Each panel has a "+" shortcut button, so don't show it for that panel.
         menu.findItem(R.id.new_tab).setVisible(mCurrentPanel != Panel.NORMAL_TABS);
         menu.findItem(R.id.new_private_tab).setVisible(mCurrentPanel != Panel.PRIVATE_TABS
-                && Restrictions.isAllowed(mContext, Restriction.DISALLOW_PRIVATE_BROWSING));
+                && Restrictions.isAllowed(mContext, Restrictable.DISALLOW_PRIVATE_BROWSING));
 
         // Only show "Clear * tabs" for current panel.
         menu.findItem(R.id.close_all_tabs).setVisible(mCurrentPanel == Panel.NORMAL_TABS);
         menu.findItem(R.id.close_private_tabs).setVisible(mCurrentPanel == Panel.PRIVATE_TABS);
 
         mPopupMenu.show();
     }
 
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testRestrictions.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testRestrictions.java
@@ -2,23 +2,23 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.tests;
 
 import static org.mozilla.gecko.tests.helpers.AssertionHelper.fAssertTrue;
 
 import org.mozilla.gecko.Restrictions;
-import org.mozilla.gecko.restrictions.Restriction;
+import org.mozilla.gecko.restrictions.Restrictable;
 import org.mozilla.gecko.tests.helpers.GeckoHelper;
 
 public class testRestrictions extends UITest {
     public void testRestrictions() {
         GeckoHelper.blockForReady();
 
         // No restrictions should be enforced when using a normal profile
-        for (Restriction restriction : Restriction.values()) {
-            fAssertTrue(String.format("Restriction %s is not enforced", restriction.name),
-                Restrictions.isAllowed(getActivity(), restriction)
+        for (Restrictable restrictable : Restrictable.values()) {
+            fAssertTrue(String.format("Restriction %s is not enforced", restrictable.name),
+                Restrictions.isAllowed(getActivity(), restrictable)
             );
         }
     }
 }