Loading core/java/android/app/IActivityManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,9 @@ interface IActivityManager { void unregisterUserSwitchObserver(in IUserSwitchObserver observer); int[] getRunningUserIds(); // Request a heap dump for the system server. void requestSystemServerHeapDump(); // Deprecated - This method is only used by a few internal components and it will soon be // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps). // No new code should be calling it. Loading core/java/android/provider/Settings.java +16 −0 Original line number Diff line number Diff line Loading @@ -12394,6 +12394,19 @@ public final class Settings { */ public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; /** * Whether to enable automatic system server heap dumps. This only works on userdebug or * eng builds, not on user builds. This is set by the user and overrides the config value. * 1 means enable, 0 means disable. * * @hide */ public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS = "enable_automatic_system_server_heap_dumps"; private static final Validator ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR = new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"}); /** * See RIL_PreferredNetworkType in ril.h * @hide Loading Loading @@ -13565,6 +13578,7 @@ public final class Settings { EMERGENCY_TONE, CALL_AUTO_RETRY, DOCK_AUDIO_MEDIA_ENABLED, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, LOW_POWER_MODE_TRIGGER_LEVEL, Loading Loading @@ -13607,6 +13621,8 @@ public final class Settings { VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR); VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR); core/java/com/android/internal/app/DumpHeapActivity.java +16 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ public class DumpHeapActivity extends Activity { public static final String KEY_PROCESS = "process"; /** The size limit the process reached */ public static final String KEY_SIZE = "size"; /** Whether the user initiated the dump or not. */ public static final String KEY_IS_USER_INITIATED = "is_user_initiated"; /** Whether the process is a system process (eg: Android System) or not. */ public static final String KEY_IS_SYSTEM_PROCESS = "is_system_process"; /** Optional name of package to directly launch */ public static final String KEY_DIRECT_LAUNCH = "direct_launch"; Loading @@ -59,6 +63,8 @@ public class DumpHeapActivity extends Activity { mProcess = getIntent().getStringExtra(KEY_PROCESS); mSize = getIntent().getLongExtra(KEY_SIZE, 0); final boolean isUserInitiated = getIntent().getBooleanExtra(KEY_IS_USER_INITIATED, false); final boolean isSystemProcess = getIntent().getBooleanExtra(KEY_IS_SYSTEM_PROCESS, false); String directLaunch = getIntent().getStringExtra(KEY_DIRECT_LAUNCH); if (directLaunch != null) { Loading @@ -81,11 +87,19 @@ public class DumpHeapActivity extends Activity { } } final int messageId; if (isUserInitiated) { messageId = com.android.internal.R.string.dump_heap_ready_text; } else if (isSystemProcess) { messageId = com.android.internal.R.string.dump_heap_system_text; } else { messageId = com.android.internal.R.string.dump_heap_text; } AlertDialog.Builder b = new AlertDialog.Builder(this, android.R.style.Theme_Material_Light_Dialog_Alert); b.setTitle(com.android.internal.R.string.dump_heap_title); b.setMessage(getString(com.android.internal.R.string.dump_heap_text, mProcess, DebugUtils.sizeValueToString(mSize, null))); b.setMessage(getString( messageId, mProcess, DebugUtils.sizeValueToString(mSize, null))); b.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Loading core/proto/android/server/activitymanagerservice.proto +1 −0 Original line number Diff line number Diff line Loading @@ -756,6 +756,7 @@ message ActivityManagerServiceDumpProcessesProto { optional string file = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; optional int32 pid = 3; optional int32 uid = 4; optional bool is_user_initiated = 5; } optional Dump dump = 2; } Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3975,4 +3975,7 @@ <!-- The type of the light sensor to be used by the display framework for things like auto-brightness. If unset, then it just gets the default sensor of type TYPE_LIGHT. --> <string name="config_displayLightSensorType" translatable="false" /> <!-- Whether or not to enable automatic heap dumps for the system server on debuggable builds. --> <bool name="config_debugEnableAutomaticSystemServerHeapDumps">false</bool> </resources> Loading
core/java/android/app/IActivityManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,9 @@ interface IActivityManager { void unregisterUserSwitchObserver(in IUserSwitchObserver observer); int[] getRunningUserIds(); // Request a heap dump for the system server. void requestSystemServerHeapDump(); // Deprecated - This method is only used by a few internal components and it will soon be // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps). // No new code should be calling it. Loading
core/java/android/provider/Settings.java +16 −0 Original line number Diff line number Diff line Loading @@ -12394,6 +12394,19 @@ public final class Settings { */ public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed"; /** * Whether to enable automatic system server heap dumps. This only works on userdebug or * eng builds, not on user builds. This is set by the user and overrides the config value. * 1 means enable, 0 means disable. * * @hide */ public static final String ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS = "enable_automatic_system_server_heap_dumps"; private static final Validator ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR = new SettingsValidators.DiscreteValueValidator(new String[] {"0", "1"}); /** * See RIL_PreferredNetworkType in ril.h * @hide Loading Loading @@ -13565,6 +13578,7 @@ public final class Settings { EMERGENCY_TONE, CALL_AUTO_RETRY, DOCK_AUDIO_MEDIA_ENABLED, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, LOW_POWER_MODE_TRIGGER_LEVEL, Loading Loading @@ -13607,6 +13621,8 @@ public final class Settings { VALIDATORS.put(EMERGENCY_TONE, EMERGENCY_TONE_VALIDATOR); VALIDATORS.put(CALL_AUTO_RETRY, CALL_AUTO_RETRY_VALIDATOR); VALIDATORS.put(DOCK_AUDIO_MEDIA_ENABLED, DOCK_AUDIO_MEDIA_ENABLED_VALIDATOR); VALIDATORS.put(ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS, ENABLE_AUTOMATIC_SYSTEM_SERVER_HEAP_DUMPS_VALIDATOR); VALIDATORS.put(ENCODED_SURROUND_OUTPUT, ENCODED_SURROUND_OUTPUT_VALIDATOR); VALIDATORS.put(ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS, ENCODED_SURROUND_OUTPUT_ENABLED_FORMATS_VALIDATOR);
core/java/com/android/internal/app/DumpHeapActivity.java +16 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,10 @@ public class DumpHeapActivity extends Activity { public static final String KEY_PROCESS = "process"; /** The size limit the process reached */ public static final String KEY_SIZE = "size"; /** Whether the user initiated the dump or not. */ public static final String KEY_IS_USER_INITIATED = "is_user_initiated"; /** Whether the process is a system process (eg: Android System) or not. */ public static final String KEY_IS_SYSTEM_PROCESS = "is_system_process"; /** Optional name of package to directly launch */ public static final String KEY_DIRECT_LAUNCH = "direct_launch"; Loading @@ -59,6 +63,8 @@ public class DumpHeapActivity extends Activity { mProcess = getIntent().getStringExtra(KEY_PROCESS); mSize = getIntent().getLongExtra(KEY_SIZE, 0); final boolean isUserInitiated = getIntent().getBooleanExtra(KEY_IS_USER_INITIATED, false); final boolean isSystemProcess = getIntent().getBooleanExtra(KEY_IS_SYSTEM_PROCESS, false); String directLaunch = getIntent().getStringExtra(KEY_DIRECT_LAUNCH); if (directLaunch != null) { Loading @@ -81,11 +87,19 @@ public class DumpHeapActivity extends Activity { } } final int messageId; if (isUserInitiated) { messageId = com.android.internal.R.string.dump_heap_ready_text; } else if (isSystemProcess) { messageId = com.android.internal.R.string.dump_heap_system_text; } else { messageId = com.android.internal.R.string.dump_heap_text; } AlertDialog.Builder b = new AlertDialog.Builder(this, android.R.style.Theme_Material_Light_Dialog_Alert); b.setTitle(com.android.internal.R.string.dump_heap_title); b.setMessage(getString(com.android.internal.R.string.dump_heap_text, mProcess, DebugUtils.sizeValueToString(mSize, null))); b.setMessage(getString( messageId, mProcess, DebugUtils.sizeValueToString(mSize, null))); b.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Loading
core/proto/android/server/activitymanagerservice.proto +1 −0 Original line number Diff line number Diff line Loading @@ -756,6 +756,7 @@ message ActivityManagerServiceDumpProcessesProto { optional string file = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; optional int32 pid = 3; optional int32 uid = 4; optional bool is_user_initiated = 5; } optional Dump dump = 2; } Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3975,4 +3975,7 @@ <!-- The type of the light sensor to be used by the display framework for things like auto-brightness. If unset, then it just gets the default sensor of type TYPE_LIGHT. --> <string name="config_displayLightSensorType" translatable="false" /> <!-- Whether or not to enable automatic heap dumps for the system server on debuggable builds. --> <bool name="config_debugEnableAutomaticSystemServerHeapDumps">false</bool> </resources>