summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/xml/debug_preferences.xml47
-rw-r--r--res/xml/hidden_debug_preferences.xml67
-rw-r--r--src/com/android/browser/BrowserPreferencesPage.java4
-rw-r--r--src/com/android/browser/BrowserSettings.java11
-rw-r--r--src/com/android/browser/preferences/DebugPreferencesFragment.java4
5 files changed, 55 insertions, 78 deletions
diff --git a/res/xml/debug_preferences.xml b/res/xml/debug_preferences.xml
index 50d4c14..5126b0d 100644
--- a/res/xml/debug_preferences.xml
+++ b/res/xml/debug_preferences.xml
@@ -29,4 +29,51 @@
android:entryValues="@array/pref_development_ua_values"
android:defaultValue="0"/>
+ <!-- The javascript console is enabled by default when the user has
+ also enabled debug mode by navigating to about:debug. -->
+ <CheckBoxPreference
+ android:key="enable_visual_indicator"
+ android:defaultValue="false"
+ android:title="@string/pref_development_visual_indicator" />
+
+ <CheckBoxPreference
+ android:key="javascript_console"
+ android:defaultValue="true"
+ android:title="@string/pref_development_error_console" />
+
+ <CheckBoxPreference
+ android:key="small_screen"
+ android:defaultValue="false"
+ android:title="@string/pref_development_single_column_rendering" />
+
+ <CheckBoxPreference
+ android:key="wide_viewport"
+ android:defaultValue="true"
+ android:title="@string/pref_development_viewport" />
+
+ <CheckBoxPreference
+ android:key="normal_layout"
+ android:defaultValue="false"
+ android:title="@string/pref_development_normal_rendering" />
+
+ <CheckBoxPreference
+ android:key="enable_tracing"
+ android:defaultValue="false"
+ android:title="@string/pref_development_trace" />
+
+ <CheckBoxPreference
+ android:key="enable_light_touch"
+ android:defaultValue="false"
+ android:title="Enable light touch" />
+
+ <CheckBoxPreference
+ android:key="enable_nav_dump"
+ android:defaultValue="false"
+ android:title="@string/pref_development_nav_dump" />
+
+ <EditTextPreference
+ android:key="js_engine_flags"
+ android:title="@string/js_engine_flags"
+ android:singleLine="true" />
+
</PreferenceScreen>
diff --git a/res/xml/hidden_debug_preferences.xml b/res/xml/hidden_debug_preferences.xml
deleted file mode 100644
index 661d9de..0000000
--- a/res/xml/hidden_debug_preferences.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android" >
-
- <!-- The javascript console is enabled by default when the user has
- also enabled debug mode by navigating to about:debug. -->
- <CheckBoxPreference
- android:key="enable_visual_indicator"
- android:defaultValue="false"
- android:title="@string/pref_development_visual_indicator" />
-
- <CheckBoxPreference
- android:key="javascript_console"
- android:defaultValue="true"
- android:title="@string/pref_development_error_console" />
-
- <CheckBoxPreference
- android:key="small_screen"
- android:defaultValue="false"
- android:title="@string/pref_development_single_column_rendering" />
-
- <CheckBoxPreference
- android:key="wide_viewport"
- android:defaultValue="true"
- android:title="@string/pref_development_viewport" />
-
- <CheckBoxPreference
- android:key="normal_layout"
- android:defaultValue="false"
- android:title="@string/pref_development_normal_rendering" />
-
- <CheckBoxPreference
- android:key="enable_tracing"
- android:defaultValue="false"
- android:title="@string/pref_development_trace" />
-
- <CheckBoxPreference
- android:key="enable_light_touch"
- android:defaultValue="false"
- android:title="Enable light touch" />
-
- <CheckBoxPreference
- android:key="enable_nav_dump"
- android:defaultValue="false"
- android:title="@string/pref_development_nav_dump" />
-
- <EditTextPreference
- android:key="js_engine_flags"
- android:title="@string/js_engine_flags"
- android:singleLine="true" />
-
-</PreferenceScreen>
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index 8031005..8302011 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -21,7 +21,6 @@ import com.android.browser.preferences.DebugPreferencesFragment;
import android.app.ActionBar;
import android.os.Bundle;
import android.preference.PreferenceActivity;
-import android.preference.PreferenceManager;
import android.view.MenuItem;
import java.util.List;
@@ -48,8 +47,7 @@ public class BrowserPreferencesPage extends PreferenceActivity {
public void onBuildHeaders(List<Header> target) {
loadHeadersFromResource(R.xml.preference_headers, target);
- if (BrowserSettings.DEV_BUILD
- || BrowserSettings.getInstance().isDebugEnabled()) {
+ if (BrowserSettings.getInstance().isDebugEnabled()) {
Header debug = new Header();
debug.title = getText(R.string.pref_development_title);
debug.fragment = DebugPreferencesFragment.class.getName();
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 642fd18..5a022ef 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -25,6 +25,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
+import android.os.Build;
import android.os.Message;
import android.preference.PreferenceManager;
import android.provider.Browser;
@@ -75,8 +76,6 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
FROYO_USERAGENT
};
- public static boolean DEV_BUILD = true;
-
private static BrowserSettings sInstance;
private Context mContext;
@@ -100,6 +99,10 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
private BrowserSettings(Context context) {
mContext = context;
mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext);
+ if (Build.VERSION.CODENAME.equals("REL")) {
+ // This is a release build, always startup with debug disabled
+ setDebugEnabled(false);
+ }
mAutofillHandler = new AutofillHandler(mContext);
mManagedSettings = new LinkedList<WeakReference<WebSettings>>();
mWebStorageSizeManager = new WebStorageSizeManager(mContext,
@@ -465,14 +468,14 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
// -----------------------------
public boolean isHardwareAccelerated() {
- if (!isDebugEnabled() && !DEV_BUILD) {
+ if (!isDebugEnabled()) {
return true;
}
return mPrefs.getBoolean(PREF_ENABLE_HARDWARE_ACCEL, true);
}
public int getUserAgent() {
- if (!isDebugEnabled() && !DEV_BUILD) {
+ if (!isDebugEnabled()) {
return 0;
}
return Integer.parseInt(mPrefs.getString(PREF_USER_AGENT, "0"));
diff --git a/src/com/android/browser/preferences/DebugPreferencesFragment.java b/src/com/android/browser/preferences/DebugPreferencesFragment.java
index 42b18cc..984c12a 100644
--- a/src/com/android/browser/preferences/DebugPreferencesFragment.java
+++ b/src/com/android/browser/preferences/DebugPreferencesFragment.java
@@ -36,10 +36,6 @@ public class DebugPreferencesFragment extends PreferenceFragment
// Load the XML preferences file
addPreferencesFromResource(R.xml.debug_preferences);
- if (BrowserSettings.getInstance().isDebugEnabled()) {
- addPreferencesFromResource(R.xml.hidden_debug_preferences);
- }
-
Preference e = findPreference(PreferenceKeys.PREF_ENABLE_HARDWARE_ACCEL);
e.setOnPreferenceChangeListener(this);
}