Merge "Fix bug #15687210 Settings crashing when turning ON<>OFF developer option."
This commit is contained in:
committed by
Android (Google) Code Review
commit
0f59467044
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@@ -57,13 +56,11 @@ 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.view.Gravity;
|
|
||||||
import android.view.HardwareRenderer;
|
import android.view.HardwareRenderer;
|
||||||
import android.view.IWindowManager;
|
import android.view.IWindowManager;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.accessibility.AccessibilityManager;
|
import android.view.accessibility.AccessibilityManager;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -163,6 +160,8 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
private static final int RESULT_DEBUG_APP = 1000;
|
private static final int RESULT_DEBUG_APP = 1000;
|
||||||
|
|
||||||
|
private static String DEFAULT_LOG_RING_BUFFER_SIZE_IN_BYTES = "262144"; // 256K
|
||||||
|
|
||||||
private IWindowManager mWindowManager;
|
private IWindowManager mWindowManager;
|
||||||
private IBackupManager mBackupManager;
|
private IBackupManager mBackupManager;
|
||||||
private DevicePolicyManager mDpm;
|
private DevicePolicyManager mDpm;
|
||||||
@@ -1076,12 +1075,16 @@ public class DevelopmentSettings extends SettingsPreferenceFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void writeLogdSizeOption(Object newValue) {
|
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();
|
pokeSystemProperties();
|
||||||
try {
|
try {
|
||||||
Process p = Runtime.getRuntime().exec("logcat -b all -G " + newValue.toString());
|
Process p = Runtime.getRuntime().exec("logcat -b all -G " + size);
|
||||||
int status = p.waitFor();
|
p.waitFor();
|
||||||
|
Log.i(TAG, "Logcat ring buffer sizes set to: " + size);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Log.w(TAG, "Cannot set logcat ring buffer sizes", e);
|
||||||
}
|
}
|
||||||
updateLogdSizeValues();
|
updateLogdSizeValues();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user