MDM Do-Not-Track Restriction

Implements handling of MDM enforced restriction preventing the user
from updating the 'Do Not Track' checkbox in the Privacy & Security
menu.

When enforced by MDM, the 'Do Not Track' menu entry is greyed out, and
if tapped, presents a toast message informing the user that the
setting is managed by the administrator.  The checkbox reflects
the value set by MDM.

Included in this commit is the basic unit tests and a new
'MdmCheckBoxPreference' class that manages the display of the toast
message and makes it possible to update the state of the entry
immediately (instead of having to restart the menu to have a new
MDM setting take effect.

Change-Id: I931d80ccf80474120dba2d768a7a257e337bece2
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 864315a..8cd2a08 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -32,6 +32,7 @@
 
 import com.android.browser.R;
 import com.android.browser.homepages.HomeProvider;
+import com.android.browser.mdm.DoNotTrackRestriction;
 import com.android.browser.mdm.ProxyRestriction;
 import com.android.browser.mdm.SearchEngineRestriction;
 import com.android.browser.platformsupport.Browser;
@@ -896,7 +897,14 @@
     }
 
     public boolean doNotTrack() {
-        return mPrefs.getBoolean(PREF_DO_NOT_TRACK, true);
+        boolean dntVal;
+        if (DoNotTrackRestriction.getInstance().isEnabled()) {
+            dntVal = DoNotTrackRestriction.getInstance().getValue();
+        }
+        else {
+            dntVal = mPrefs.getBoolean(PREF_DO_NOT_TRACK, true);
+        }
+        return dntVal;
     }
 
     public boolean acceptCookies() {