Merge changes I8f067f14,I54d8255a,Ib15917bf

* changes:
  Settings: crashing when turning ON<>OFF developer option. DO NOT MERGE
  Settings: logd: increase dialog title field size to 59
  Settings: logd: increase summary field size to 30
This commit is contained in:
Mark Salyzyn
2014-06-18 14:12:52 +00:00
committed by Gerrit Code Review
3 changed files with 11 additions and 5 deletions

View File

@@ -909,7 +909,7 @@
<item>16777216</item>
</string-array>
<!-- Summaries for logd limit size selection preference. [CHAR LIMIT=19]-->
<!-- Summaries for logd limit size selection preference. [CHAR LIMIT=30]-->
<string-array name="select_logd_size_summaries" >
<item>64K per log buffer</item>
<item>256K per log buffer</item>

View File

@@ -3168,7 +3168,7 @@
<string name="wifi_display_certification_summary">Show options for wireless display certification</string>
<!-- UI debug setting: limit size of Android logger buffers -->
<string name="select_logd_size_title">Logger buffer sizes</string>
<!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=34] -->
<!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
<string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
<!-- Setting Checkbox title whether to allow mock locations -->
<string name="allow_mock_location">Allow mock locations</string>

View File

@@ -150,6 +150,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private static final int RESULT_DEBUG_APP = 1000;
private static String DEFAULT_LOG_RING_BUFFER_SIZE_IN_BYTES = "262144"; // 256K
private IWindowManager mWindowManager;
private IBackupManager mBackupManager;
private DevicePolicyManager mDpm;
@@ -993,12 +995,16 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
}
private void writeLogdSizeOption(Object newValue) {
SystemProperties.set(SELECT_LOGD_SIZE_PROPERTY, newValue.toString());
final String size = (newValue != null) ?
newValue.toString() : DEFAULT_LOG_RING_BUFFER_SIZE_IN_BYTES;
SystemProperties.set(SELECT_LOGD_SIZE_PROPERTY, size);
pokeSystemProperties();
try {
Process p = Runtime.getRuntime().exec("logcat -b all -G " + newValue.toString());
int status = p.waitFor();
Process p = Runtime.getRuntime().exec("logcat -b all -G " + size);
p.waitFor();
Log.i(TAG, "Logcat ring buffer sizes set to: " + size);
} catch (Exception e) {
Log.w(TAG, "Cannot set logcat ring buffer sizes", e);
}
updateLogdSizeValues();
}