diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-06-13 14:57:13 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-06-13 14:57:13 -0700 |
commit | 6b5bcd213852a3fbff3ec427176862bc9b97e97f (patch) | |
tree | 3ba2be89131ad4b93ef5d9d5bc7249d75088ea13 /src | |
parent | a6fa002315c58ec4fd779ad27c4dacbcd631d980 (diff) | |
parent | c2c64a312a0ccec59c13ee0d04b8ffc730b7a3b7 (diff) | |
download | packages_apps_Settings-6b5bcd213852a3fbff3ec427176862bc9b97e97f.zip packages_apps_Settings-6b5bcd213852a3fbff3ec427176862bc9b97e97f.tar.gz packages_apps_Settings-6b5bcd213852a3fbff3ec427176862bc9b97e97f.tar.bz2 |
resolved conflicts for merge of c2c64a31 to master
Change-Id: Ica0f138d4bf2cf66b8ba485bf286e062be433d0a
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/DevelopmentSettings.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index 6d1cadc..02045ab 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -139,6 +139,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private static final String DEBUG_APPLICATIONS_CATEGORY_KEY = "debug_applications_category"; private static final String WIFI_DISPLAY_CERTIFICATION_KEY = "wifi_display_certification"; private static final String WIFI_VERBOSE_LOGGING_KEY = "wifi_verbose_logging"; + private static final String SELECT_LOGD_SIZE_KEY = "select_logd_size"; + private static final String SELECT_LOGD_SIZE_PROPERTY = "persist.logd.size"; + private static final String SELECT_LOGD_DEFAULT_SIZE_PROPERTY = "ro.logd.size"; private static final String OPENGL_TRACES_KEY = "enable_opengl_traces"; @@ -201,6 +204,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment private CheckBoxPreference mDebugLayout; private CheckBoxPreference mForceRtlLayout; private ListPreference mDebugHwOverdraw; + private ListPreference mLogdSize; private ListPreference mTrackFrameTime; private ListPreference mShowNonRectClip; private ListPreference mWindowAnimationScale; @@ -316,6 +320,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY); mWifiDisplayCertification = findAndInitCheckboxPref(WIFI_DISPLAY_CERTIFICATION_KEY); mWifiVerboseLogging = findAndInitCheckboxPref(WIFI_VERBOSE_LOGGING_KEY); + mLogdSize = addListPreference(SELECT_LOGD_SIZE_KEY); + mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY); mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY); mAnimatorDurationScale = addListPreference(ANIMATOR_DURATION_SCALE_KEY); @@ -520,6 +526,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateVerifyAppsOverUsbOptions(); updateBugreportOptions(); updateForceRtlOptions(); + updateLogdSizeValues(); updateWifiDisplayCertificationOptions(); updateWifiVerboseLoggingOptions(); updateSimulateColorSpace(); @@ -536,6 +543,7 @@ public class DevelopmentSettings extends SettingsPreferenceFragment } } resetDebuggerOptions(); + writeLogdSizeOption(null); writeAnimationScaleOption(0, mWindowAnimationScale, null); writeAnimationScaleOption(1, mTransitionAnimationScale, null); writeAnimationScaleOption(2, mAnimatorDurationScale, null); @@ -1037,6 +1045,43 @@ public class DevelopmentSettings extends SettingsPreferenceFragment mWifiManager.enableVerboseLogging(mWifiVerboseLogging.isChecked() ? 1 : 0); } + private void updateLogdSizeValues() { + if (mLogdSize != null) { + String currentValue = SystemProperties.get(SELECT_LOGD_SIZE_PROPERTY); + if (currentValue == null) { + currentValue = SystemProperties.get(SELECT_LOGD_DEFAULT_SIZE_PROPERTY); + if (currentValue == null) { + currentValue = "256K"; + } + } + String[] values = getResources().getStringArray(R.array.select_logd_size_values); + String[] titles = getResources().getStringArray(R.array.select_logd_size_titles); + String[] summaries = getResources().getStringArray(R.array.select_logd_size_summaries); + int index = 1; // punt to second entry if not found + for (int i = 0; i < values.length; i++) { + if (currentValue.equals(values[i]) + || currentValue.equals(titles[i])) { + index = i; + break; + } + } + mLogdSize.setValue(values[index]); + mLogdSize.setSummary(summaries[index]); + mLogdSize.setOnPreferenceChangeListener(this); + } + } + + private void writeLogdSizeOption(Object newValue) { + SystemProperties.set(SELECT_LOGD_SIZE_PROPERTY, newValue.toString()); + pokeSystemProperties(); + try { + Process p = Runtime.getRuntime().exec("logcat -b all -G " + newValue.toString()); + int status = p.waitFor(); + } catch (Exception e) { + } + updateLogdSizeValues(); + } + private void updateCpuUsageOptions() { updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(), Settings.Global.SHOW_PROCESSES, 0) != 0); @@ -1383,6 +1428,9 @@ public class DevelopmentSettings extends SettingsPreferenceFragment updateHdcpValues(); pokeSystemProperties(); return true; + } else if (preference == mLogdSize) { + writeLogdSizeOption(newValue); + return true; } else if (preference == mWindowAnimationScale) { writeAnimationScaleOption(0, mWindowAnimationScale, newValue); return true; |