<item>Use ART debug build</item>
</string-array>
+ <!-- Titles for logd limit size selection preference. [CHAR LIMIT=14] -->
+ <string-array name="select_logd_size_titles">
+ <item>64K</item>
+ <item>256K</item>
+ <item>1M</item>
+ <item>4M</item>
+ <item>16M</item>
+ </string-array>
+
+ <!-- Values for logd limit size selection preference. -->
+ <string-array name="select_logd_size_values" translatable="false" >
+ <item>65536</item>
+ <item>262144</item>
+ <item>1048576</item>
+ <item>4194304</item>
+ <item>16777216</item>
+ </string-array>
+
+ <!-- Summaries for logd limit size selection preference. [CHAR LIMIT=19]-->
+ <string-array name="select_logd_size_summaries" >
+ <item>64K per log buffer</item>
+ <item>256K per log buffer</item>
+ <item>1M per log buffer</item>
+ <item>4M per log buffer</item>
+ <item>16M per log buffer</item>
+ </string-array>
+
<!-- Titles for HDCP checking preference. [CHAR LIMIT=35] -->
<string-array name="hdcp_checking_titles">
<item>Never check</item>
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";
private CheckBoxPreference mDebugLayout;
private CheckBoxPreference mForceRtlLayout;
private ListPreference mDebugHwOverdraw;
+ private ListPreference mLogdSize;
private ListPreference mTrackFrameTime;
private ListPreference mShowNonRectClip;
private ListPreference mWindowAnimationScale;
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);
updateVerifyAppsOverUsbOptions();
updateBugreportOptions();
updateForceRtlOptions();
+ updateLogdSizeValues();
updateWifiDisplayCertificationOptions();
updateWifiVerboseLoggingOptions();
updateSimulateColorSpace();
}
}
resetDebuggerOptions();
+ writeLogdSizeOption(null);
writeAnimationScaleOption(0, mWindowAnimationScale, null);
writeAnimationScaleOption(1, mTransitionAnimationScale, null);
writeAnimationScaleOption(2, mAnimatorDurationScale, null);
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);
updateHdcpValues();
pokeSystemProperties();
return true;
+ } else if (preference == mLogdSize) {
+ writeLogdSizeOption(newValue);
+ return true;
} else if (preference == mWindowAnimationScale) {
writeAnimationScaleOption(0, mWindowAnimationScale, newValue);
return true;