am 3c6c45f9: am a95604de: Merge "Adding developer toggle for using Chromium WebView." into jb-mr2-dev

* commit '3c6c45f931307af098e790e86b114c804655f42b':
  Adding developer toggle for using Chromium WebView.
This commit is contained in:
Kristian Monsen
2013-04-05 10:51:22 -07:00
committed by Android Git Automerger
3 changed files with 41 additions and 0 deletions

View File

@@ -4007,6 +4007,11 @@
<string name="show_all_anrs_summary">Show App Not Responding dialog <string name="show_all_anrs_summary">Show App Not Responding dialog
for background apps</string> for background apps</string>
<!-- UI debug setting: use experimental WebView [CHAR LIMIT=25] -->
<string name="experimental_webview">Use Experimental WebView</string>
<!-- UI debug setting: use experimental WebView summary [CHAR LIMIT=50] -->
<string name="experimental_webview_summary">Apps will use the newest (beta) WebView</string>
<!-- Activity title for network data usage summary. [CHAR LIMIT=25] --> <!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
<string name="data_usage_summary_title">Data usage</string> <string name="data_usage_summary_title">Data usage</string>
<!-- Title for option to pick visible time range from a list available usage periods. [CHAR LIMIT=25] --> <!-- Title for option to pick visible time range from a list available usage periods. [CHAR LIMIT=25] -->

View File

@@ -239,6 +239,11 @@
android:title="@string/show_all_anrs" android:title="@string/show_all_anrs"
android:summary="@string/show_all_anrs_summary"/> android:summary="@string/show_all_anrs_summary"/>
<CheckBoxPreference
android:key="experimental_webview"
android:title="@string/experimental_webview"
android:summary="@string/experimental_webview_summary"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View File

@@ -58,6 +58,7 @@ import android.preference.PreferenceScreen;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.webkit.WebViewFactory;
import android.view.Gravity; import android.view.Gravity;
import android.view.HardwareRenderer; import android.view.HardwareRenderer;
import android.view.IWindowManager; import android.view.IWindowManager;
@@ -132,6 +133,8 @@ public class DevelopmentSettings extends PreferenceFragment
private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs"; private static final String SHOW_ALL_ANRS_KEY = "show_all_anrs";
private static final String WEBVIEW_EXPERIMENTAL_KEY = "experimental_webview";
private static final String TAG_CONFIRM_ENFORCE = "confirm_enforce"; private static final String TAG_CONFIRM_ENFORCE = "confirm_enforce";
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive"; private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
@@ -188,6 +191,7 @@ public class DevelopmentSettings extends PreferenceFragment
private ListPreference mAppProcessLimit; private ListPreference mAppProcessLimit;
private CheckBoxPreference mShowAllANRs; private CheckBoxPreference mShowAllANRs;
private CheckBoxPreference mExperimentalWebView;
private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>(); private final ArrayList<Preference> mAllPrefs = new ArrayList<Preference>();
private final ArrayList<CheckBoxPreference> mResetCbPrefs private final ArrayList<CheckBoxPreference> mResetCbPrefs
@@ -285,6 +289,15 @@ public class DevelopmentSettings extends PreferenceFragment
mAllPrefs.add(mShowAllANRs); mAllPrefs.add(mShowAllANRs);
mResetCbPrefs.add(mShowAllANRs); mResetCbPrefs.add(mShowAllANRs);
if (WebViewFactory.isExperimentalWebViewAvailable()) {
mExperimentalWebView = findAndInitCheckboxPref(WEBVIEW_EXPERIMENTAL_KEY);
} else {
Preference experimentalWebView = findPreference(WEBVIEW_EXPERIMENTAL_KEY);
if (experimentalWebView != null) {
getPreferenceScreen().removePreference(experimentalWebView);
}
}
Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY); Preference hdcpChecking = findPreference(HDCP_CHECKING_KEY);
if (hdcpChecking != null) { if (hdcpChecking != null) {
mAllPrefs.add(hdcpChecking); mAllPrefs.add(hdcpChecking);
@@ -446,6 +459,7 @@ public class DevelopmentSettings extends PreferenceFragment
updateImmediatelyDestroyActivitiesOptions(); updateImmediatelyDestroyActivitiesOptions();
updateAppProcessLimitOptions(); updateAppProcessLimitOptions();
updateShowAllANRsOptions(); updateShowAllANRsOptions();
updateExperimentalWebViewOptions();
updateVerifyAppsOverUsbOptions(); updateVerifyAppsOverUsbOptions();
updateBugreportOptions(); updateBugreportOptions();
} }
@@ -972,6 +986,21 @@ public class DevelopmentSettings extends PreferenceFragment
getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0); getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0);
} }
private void writeExperimentalWebViewOptions() {
if (mExperimentalWebView != null) {
SystemProperties.set(WebViewFactory.WEBVIEW_EXPERIMENTAL_PROPERTY,
mExperimentalWebView.isChecked() ? "true" : null);
pokeSystemProperties();
}
}
private void updateExperimentalWebViewOptions() {
if (mExperimentalWebView != null) {
updateCheckBox(mExperimentalWebView, SystemProperties.getBoolean(
WebViewFactory.WEBVIEW_EXPERIMENTAL_PROPERTY, false));
}
}
@Override @Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (buttonView == mEnabledSwitch) { if (buttonView == mEnabledSwitch) {
@@ -1091,6 +1120,8 @@ public class DevelopmentSettings extends PreferenceFragment
writeImmediatelyDestroyActivitiesOptions(); writeImmediatelyDestroyActivitiesOptions();
} else if (preference == mShowAllANRs) { } else if (preference == mShowAllANRs) {
writeShowAllANRsOptions(); writeShowAllANRsOptions();
} else if (preference == mExperimentalWebView) {
writeExperimentalWebViewOptions();
} else if (preference == mForceHardwareUi) { } else if (preference == mForceHardwareUi) {
writeHardwareUiOptions(); writeHardwareUiOptions();
} else if (preference == mForceMsaa) { } else if (preference == mForceMsaa) {