diff options
author | Dave Tharp <dtharp@codeaurora.org> | 2015-06-25 13:34:27 -0700 |
---|---|---|
committer | jrizzoli <joey@cyanogenmoditalia.it> | 2015-08-28 13:15:45 +0200 |
commit | cda155abb868b2bb54816f87258878db6b030b4a (patch) | |
tree | 6f5aecc5e886dbb68f747562c3547a55b5f8e991 /src/com/android/browser/mdm | |
parent | 6cfd30ef5810d0d9a1fec804b962e27ee4b85b9a (diff) | |
download | android_packages_apps_Gello-cda155abb868b2bb54816f87258878db6b030b4a.tar.gz android_packages_apps_Gello-cda155abb868b2bb54816f87258878db6b030b4a.tar.bz2 android_packages_apps_Gello-cda155abb868b2bb54816f87258878db6b030b4a.zip |
[MDM] Adjust Do-Not-Track Restriction for new UI
Needed to move DNT initialization from GeneralPreferencesFragment
to PrivacySecurityPreferencesFragment.
Change-Id: I96eeeb8636accbf774b0569a3d1e953e7a14bf4e
Diffstat (limited to 'src/com/android/browser/mdm')
-rw-r--r-- | src/com/android/browser/mdm/DoNotTrackRestriction.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/browser/mdm/DoNotTrackRestriction.java b/src/com/android/browser/mdm/DoNotTrackRestriction.java index 2f4a540f..c1e56054 100644 --- a/src/com/android/browser/mdm/DoNotTrackRestriction.java +++ b/src/com/android/browser/mdm/DoNotTrackRestriction.java @@ -30,10 +30,14 @@ package com.android.browser.mdm; +import android.content.SharedPreferences; import android.os.Bundle; import android.preference.Preference; -public class DoNotTrackRestriction extends Restriction { +import com.android.browser.BrowserSettings; +import com.android.browser.PreferenceKeys; + +public class DoNotTrackRestriction extends Restriction implements PreferenceKeys { private final static String TAG = "DoNotTrackRestriction"; @@ -60,6 +64,7 @@ public class DoNotTrackRestriction extends Restriction { @Override public void enforce(Bundle restrictions) { + SharedPreferences.Editor editor = BrowserSettings.getInstance().getPreferences().edit(); // Possible states // DNT_enabled DNT_value | menu-item-enabled check-box-value // ----------------------------------------------------------------- @@ -72,6 +77,9 @@ public class DoNotTrackRestriction extends Restriction { if (dntEnabled) { mDntValue = restrictions.getBoolean(DO_NOT_TRACK_VALUE, true); // default to true + editor.putBoolean(PREF_DO_NOT_TRACK, mDntValue); + editor.apply(); + // enable the restriction : controls enable of the menu item // Log.i(TAG, "DNT Restriction enabled. new val [" + mDntValue + "]"); enable(true); |