Loading res/values/strings.xml +30 −12 Original line number Diff line number Diff line Loading @@ -3570,8 +3570,14 @@ <string name="wait_for_debugger_summary">Debugged application waits for debugger to attach before executing</string> <!-- Preference category for user interface debugging development settings. [CHAR LIMIT=25] --> <string name="debug_ui_category">User interface</string> <!-- Preference category for input debugging development settings. [CHAR LIMIT=25] --> <string name="debug_input_category">Input</string> <!-- Preference category for drawing debugging development settings. [CHAR LIMIT=25] --> <string name="debug_drawing_category">Drawing</string> <!-- Preference category for monitoring debugging development settings. [CHAR LIMIT=25] --> <string name="debug_monitoring_category">Monitoring</string> <!-- UI debug setting: always enable strict mode? [CHAR LIMIT=25] --> <string name="strict_mode">Strict mode enabled</string> Loading @@ -3589,20 +3595,32 @@ <!-- UI debug setting: show touches location summary [CHAR LIMIT=50] --> <string name="show_touches_summary">Show visual feedback for touches</string> <!-- UI debug setting: show where screen updates happen? [CHAR LIMIT=25] --> <string name="show_screen_updates">Show screen updates</string> <!-- UI debug setting: show screen updates summary [CHAR LIMIT=50] --> <string name="show_screen_updates_summary">Flash areas of screen when they update</string> <!-- UI debug setting: show where surface updates happen? [CHAR LIMIT=25] --> <string name="show_screen_updates">Show surface updates</string> <!-- UI debug setting: show surface updates summary [CHAR LIMIT=50] --> <string name="show_screen_updates_summary">Flash entire window surfaces when they update</string> <!-- UI debug setting: show where screen updates happen with GPU rendering? [CHAR LIMIT=25] --> <string name="show_hw_screen_updates">Show GPU screen updates</string> <!-- UI debug setting: show where window updates happen with GPU rendering? [CHAR LIMIT=25] --> <string name="show_hw_screen_updates">Show GPU view updates</string> <!-- UI debug setting: show GPU rendering screen updates summary [CHAR LIMIT=50] --> <string name="show_hw_screen_updates_summary">Flash areas of screen when they update with the GPU</string> <string name="show_hw_screen_updates_summary">Flash views inside windows when drawn with the GPU</string> <!-- UI debug setting: disable use of overlays? [CHAR LIMIT=25] --> <string name="disable_overlays">Disable overlays</string> <string name="disable_overlays">Disable HW overlays</string> <!-- UI debug setting: disable use of overlays summary [CHAR LIMIT=50] --> <string name="disable_overlays_summary">Don\'t use overlays for screen compositing</string> <string name="disable_overlays_summary">Always use GPU for screen compositing</string> <!-- UI debug setting: enable low-level traces? [CHAR LIMIT=25] --> <string name="enable_traces_title">Enable traces</string> <!-- UI debug setting: title for dialog to enable low-level traces [CHAR LIMIT=25] --> <string name="enable_traces_dialog_title">Select enabled traces</string> <!-- UI debug setting: enable low-level traces, none enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_none">No traces currently enabled</string> <!-- UI debug setting: enable low-level traces, some number enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_num"><xliff:g id="num">%1$d</xliff:g> traces currently enabled</string> <!-- UI debug setting: enable low-level traces, all enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_all">All traces currently enabled</string> <!-- UI debug setting: show layout bounds information [CHAR LIMIT=25] --> <string name="debug_layout">Show layout bounds</string> Loading @@ -3617,7 +3635,7 @@ <!-- UI debug setting: force hardware acceleration to render apps [CHAR LIMIT=25] --> <string name="force_hw_ui">Force GPU rendering</string> <!-- UI debug setting: force hardware acceleration summary [CHAR LIMIT=50] --> <string name="force_hw_ui_summary">Use 2D hardware acceleration in applications</string> <string name="force_hw_ui_summary">Force use of GPU for 2d drawing</string> <!-- UI debug setting: profile time taken by hardware acceleration to render apps [CHAR LIMIT=25] --> <string name="track_frame_time">Profile GPU rendering</string> Loading res/xml/development_prefs.xml +47 −32 Original line number Diff line number Diff line Loading @@ -62,58 +62,38 @@ </PreferenceCategory> <PreferenceCategory android:key="debug_ui_category" android:title="@string/debug_ui_category"> <PreferenceCategory android:key="debug_input_category" android:title="@string/debug_input_category"> <CheckBoxPreference android:key="strict_mode" android:title="@string/strict_mode" android:summary="@string/strict_mode_summary"/> android:key="show_touches" android:title="@string/show_touches" android:summary="@string/show_touches_summary"/> <CheckBoxPreference android:key="pointer_location" android:title="@string/pointer_location" android:summary="@string/pointer_location_summary"/> <CheckBoxPreference android:key="show_touches" android:title="@string/show_touches" android:summary="@string/show_touches_summary"/> </PreferenceCategory> <PreferenceCategory android:key="debug_drawing_category" android:title="@string/debug_drawing_category"> <CheckBoxPreference android:key="debug_layout" android:title="@string/debug_layout" android:summary="@string/debug_layout_summary"/> <CheckBoxPreference android:key="show_screen_updates" android:title="@string/show_screen_updates" android:summary="@string/show_screen_updates_summary"/> <CheckBoxPreference android:key="disable_overlays" android:title="@string/disable_overlays" android:summary="@string/disable_overlays_summary"/> <CheckBoxPreference android:key="show_cpu_usage" android:title="@string/show_cpu_usage" android:summary="@string/show_cpu_usage_summary"/> <CheckBoxPreference android:key="force_hw_ui" android:title="@string/force_hw_ui" android:summary="@string/force_hw_ui_summary"/> <CheckBoxPreference android:key="show_hw_screen_udpates" android:title="@string/show_hw_screen_updates" android:summary="@string/show_hw_screen_updates_summary"/> <CheckBoxPreference android:key="track_frame_time" android:title="@string/track_frame_time" android:summary="@string/track_frame_time_summary"/> android:key="show_screen_updates" android:title="@string/show_screen_updates" android:summary="@string/show_screen_updates_summary"/> <ListPreference android:key="window_animation_scale" Loading @@ -136,6 +116,41 @@ android:entries="@array/animator_duration_scale_entries" android:entryValues="@array/animator_duration_scale_values" /> <CheckBoxPreference android:key="disable_overlays" android:title="@string/disable_overlays" android:summary="@string/disable_overlays_summary"/> <CheckBoxPreference android:key="force_hw_ui" android:title="@string/force_hw_ui" android:summary="@string/force_hw_ui_summary"/> </PreferenceCategory> <PreferenceCategory android:key="debug_monitoring_category" android:title="@string/debug_monitoring_category"> <CheckBoxPreference android:key="strict_mode" android:title="@string/strict_mode" android:summary="@string/strict_mode_summary"/> <CheckBoxPreference android:key="show_cpu_usage" android:title="@string/show_cpu_usage" android:summary="@string/show_cpu_usage_summary"/> <CheckBoxPreference android:key="track_frame_time" android:title="@string/track_frame_time" android:summary="@string/track_frame_time_summary"/> <MultiCheckPreference android:key="enable_traces" android:title="@string/enable_traces_title" android:dialogTitle="@string/enable_traces_dialog_title" /> </PreferenceCategory> <PreferenceCategory android:key="debug_applications_category" Loading src/com/android/settings/DevelopmentSettings.java +102 −16 Original line number Diff line number Diff line Loading @@ -39,8 +39,10 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.os.StrictMode; import android.os.SystemProperties; import android.os.Trace; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.MultiCheckPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; Loading Loading @@ -85,6 +87,8 @@ public class DevelopmentSettings extends PreferenceFragment private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale"; private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale"; private static final String ENABLE_TRACES_KEY = "enable_traces"; private static final String IMMEDIATELY_DESTROY_ACTIVITIES_KEY = "immediately_destroy_activities"; private static final String APP_PROCESS_LIMIT_KEY = "app_process_limit"; Loading @@ -98,6 +102,7 @@ public class DevelopmentSettings extends PreferenceFragment private Switch mEnabledSwitch; private boolean mLastEnabledState; private boolean mHaveDebugSettings; private CheckBoxPreference mEnableAdb; private CheckBoxPreference mKeepScreenOn; Loading @@ -121,6 +126,7 @@ public class DevelopmentSettings extends PreferenceFragment private ListPreference mWindowAnimationScale; private ListPreference mTransitionAnimationScale; private ListPreference mAnimatorDurationScale; private MultiCheckPreference mEnableTracesPref; private CheckBoxPreference mImmediatelyDestroyActivities; private ListPreference mAppProcessLimit; Loading Loading @@ -174,6 +180,15 @@ public class DevelopmentSettings extends PreferenceFragment mAnimatorDurationScale = (ListPreference) findPreference(ANIMATOR_DURATION_SCALE_KEY); mAllPrefs.add(mAnimatorDurationScale); mAnimatorDurationScale.setOnPreferenceChangeListener(this); mEnableTracesPref = (MultiCheckPreference)findPreference(ENABLE_TRACES_KEY); String[] traceValues = new String[Trace.TRACE_TAGS.length]; for (int i=Trace.TRACE_FLAGS_START_BIT; i<traceValues.length; i++) { traceValues[i] = Integer.toString(1<<i); } mEnableTracesPref.setEntries(Trace.TRACE_TAGS); mEnableTracesPref.setEntryValues(traceValues); mAllPrefs.add(mEnableTracesPref); mEnableTracesPref.setOnPreferenceChangeListener(this); mImmediatelyDestroyActivities = (CheckBoxPreference) findPreference( IMMEDIATELY_DESTROY_ACTIVITIES_KEY); Loading Loading @@ -265,15 +280,32 @@ public class DevelopmentSettings extends PreferenceFragment Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; mEnabledSwitch.setChecked(mLastEnabledState); setPrefsEnabledState(mLastEnabledState); if (mHaveDebugSettings && !mLastEnabledState) { // Overall debugging is disabled, but there are some debug // settings that are enabled. This is an invalid state. Switch // to debug settings being enabled, so the user knows there is // stuff enabled and can turn it all off if they want. Settings.Secure.putInt(getActivity().getContentResolver(), Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED, 1); mLastEnabledState = true; setPrefsEnabledState(mLastEnabledState); } } void updateCheckBox(CheckBoxPreference checkBox, boolean value) { checkBox.setChecked(value); mHaveDebugSettings |= value; } private void updateAllOptions() { final ContentResolver cr = getActivity().getContentResolver(); mEnableAdb.setChecked(Settings.Secure.getInt(cr, mHaveDebugSettings = false; updateCheckBox(mEnableAdb, Settings.Secure.getInt(cr, Settings.Secure.ADB_ENABLED, 0) != 0); mKeepScreenOn.setChecked(Settings.System.getInt(cr, updateCheckBox(mKeepScreenOn, Settings.System.getInt(cr, Settings.System.STAY_ON_WHILE_PLUGGED_IN, 0) != 0); mAllowMockLocation.setChecked(Settings.Secure.getInt(cr, updateCheckBox(mAllowMockLocation, Settings.Secure.getInt(cr, Settings.Secure.ALLOW_MOCK_LOCATION, 0) != 0); updateHdcpValues(); updatePasswordSummary(); Loading @@ -288,6 +320,7 @@ public class DevelopmentSettings extends PreferenceFragment updateShowHwScreenUpdatesOptions(); updateDebugLayoutOptions(); updateAnimationScaleOptions(); updateEnableTracesOptions(); updateImmediatelyDestroyActivitiesOptions(); updateAppProcessLimitOptions(); updateShowAllANRsOptions(); Loading @@ -305,7 +338,9 @@ public class DevelopmentSettings extends PreferenceFragment writeAnimationScaleOption(0, mWindowAnimationScale, null); writeAnimationScaleOption(1, mTransitionAnimationScale, null); writeAnimationScaleOption(2, mAnimatorDurationScale, null); writeEnableTracesOptions(0); writeAppProcessLimitOptions(null); mHaveDebugSettings = false; updateAllOptions(); } Loading Loading @@ -359,7 +394,7 @@ public class DevelopmentSettings extends PreferenceFragment private void updateDebuggerOptions() { mDebugApp = Settings.System.getString( getActivity().getContentResolver(), Settings.System.DEBUG_APP); mWaitForDebugger.setChecked(Settings.System.getInt( updateCheckBox(mWaitForDebugger, Settings.System.getInt( getActivity().getContentResolver(), Settings.System.WAIT_FOR_DEBUGGER, 0) != 0); if (mDebugApp != null && mDebugApp.length() > 0) { String label; Loading @@ -373,6 +408,7 @@ public class DevelopmentSettings extends PreferenceFragment } mDebugAppPref.setSummary(getResources().getString(R.string.debug_app_set, label)); mWaitForDebugger.setEnabled(true); mHaveDebugSettings = true; } else { mDebugAppPref.setSummary(getResources().getString(R.string.debug_app_not_set)); mWaitForDebugger.setEnabled(false); Loading Loading @@ -401,7 +437,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateStrictModeVisualOptions() { mStrictMode.setChecked(currentStrictModeActiveIndex() == 1); updateCheckBox(mStrictMode, currentStrictModeActiveIndex() == 1); } private void writePointerLocationOptions() { Loading @@ -410,7 +446,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updatePointerLocationOptions() { mPointerLocation.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mPointerLocation, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.POINTER_LOCATION, 0) != 0); } Loading @@ -420,7 +456,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowTouchesOptions() { mShowTouches.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mShowTouches, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.SHOW_TOUCHES, 0) != 0); } Loading @@ -438,11 +474,11 @@ public class DevelopmentSettings extends PreferenceFragment @SuppressWarnings("unused") int enableGL = reply.readInt(); int showUpdates = reply.readInt(); mShowScreenUpdates.setChecked(showUpdates != 0); updateCheckBox(mShowScreenUpdates, showUpdates != 0); @SuppressWarnings("unused") int showBackground = reply.readInt(); int disableOverlays = reply.readInt(); mDisableOverlays.setChecked(disableOverlays != 0); updateCheckBox(mDisableOverlays, disableOverlays != 0); reply.recycle(); data.recycle(); } Loading Loading @@ -485,7 +521,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateHardwareUiOptions() { mForceHardwareUi.setChecked(SystemProperties.getBoolean(HARDWARE_UI_PROPERTY, false)); updateCheckBox(mForceHardwareUi, SystemProperties.getBoolean(HARDWARE_UI_PROPERTY, false)); } private void writeHardwareUiOptions() { Loading @@ -493,7 +529,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateTrackFrameTimeOptions() { mTrackFrameTime.setChecked( updateCheckBox(mTrackFrameTime, SystemProperties.getBoolean(HardwareRenderer.PROFILE_PROPERTY, false)); } Loading @@ -503,7 +539,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowHwScreenUpdatesOptions() { mShowHwScreenUpdates.setChecked( updateCheckBox(mShowHwScreenUpdates, SystemProperties.getBoolean(HardwareRenderer.DEBUG_DIRTY_REGIONS_PROPERTY, false)); } Loading @@ -513,7 +549,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateDebugLayoutOptions() { mDebugLayout.setChecked( updateCheckBox(mDebugLayout, SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false)); } Loading @@ -523,7 +559,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateCpuUsageOptions() { mShowCpuUsage.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mShowCpuUsage, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.SHOW_PROCESSES, 0) != 0); } Loading @@ -549,13 +585,16 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateImmediatelyDestroyActivitiesOptions() { mImmediatelyDestroyActivities.setChecked(Settings.System.getInt( updateCheckBox(mImmediatelyDestroyActivities, Settings.System.getInt( getActivity().getContentResolver(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0) != 0); } private void updateAnimationScaleValue(int which, ListPreference pref) { try { float scale = mWindowManager.getAnimationScale(which); if (scale != 1) { mHaveDebugSettings = true; } CharSequence[] values = pref.getEntryValues(); for (int i=0; i<values.length; i++) { float val = Float.parseFloat(values[i].toString()); Loading Loading @@ -593,6 +632,9 @@ public class DevelopmentSettings extends PreferenceFragment for (int i=0; i<values.length; i++) { int val = Integer.parseInt(values[i].toString()); if (val >= limit) { if (i != 0) { mHaveDebugSettings = true; } mAppProcessLimit.setValueIndex(i); mAppProcessLimit.setSummary(mAppProcessLimit.getEntries()[i]); return; Loading Loading @@ -620,10 +662,51 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowAllANRsOptions() { mShowAllANRs.setChecked(Settings.Secure.getInt( updateCheckBox(mShowAllANRs, Settings.Secure.getInt( getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0); } private void updateEnableTracesOptions() { String strValue = SystemProperties.get(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS); long flags = SystemProperties.getLong(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, 0); String[] values = mEnableTracesPref.getEntryValues(); int numSet = 0; for (int i=Trace.TRACE_FLAGS_START_BIT; i<values.length; i++) { boolean set = (flags&(1<<i)) != 0; mEnableTracesPref.setValue(i-Trace.TRACE_FLAGS_START_BIT, set); if (set) { numSet++; } } if (numSet == 0) { mEnableTracesPref.setSummary(R.string.enable_traces_summary_none); } else if (numSet == values.length) { mHaveDebugSettings = true; mEnableTracesPref.setSummary(R.string.enable_traces_summary_all); } else { mHaveDebugSettings = true; mEnableTracesPref.setSummary(getString(R.string.enable_traces_summary_num, numSet)); } } private void writeEnableTracesOptions() { long value = 0; String[] values = mEnableTracesPref.getEntryValues(); for (int i=Trace.TRACE_FLAGS_START_BIT; i<values.length; i++) { if (mEnableTracesPref.getValue(i-Trace.TRACE_FLAGS_START_BIT)) { value |= 1<<i; } } writeEnableTracesOptions(value); // Make sure summary is updated. updateEnableTracesOptions(); } private void writeEnableTracesOptions(long value) { SystemProperties.set(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, "0x" + Long.toString(value, 16)); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView == mEnabledSwitch) { Loading Loading @@ -744,6 +827,9 @@ public class DevelopmentSettings extends PreferenceFragment } else if (preference == mAnimatorDurationScale) { writeAnimationScaleOption(2, mAnimatorDurationScale, newValue); return true; } else if (preference == mEnableTracesPref) { writeEnableTracesOptions(); return true; } else if (preference == mAppProcessLimit) { writeAppProcessLimitOptions(newValue); return true; Loading Loading
res/values/strings.xml +30 −12 Original line number Diff line number Diff line Loading @@ -3570,8 +3570,14 @@ <string name="wait_for_debugger_summary">Debugged application waits for debugger to attach before executing</string> <!-- Preference category for user interface debugging development settings. [CHAR LIMIT=25] --> <string name="debug_ui_category">User interface</string> <!-- Preference category for input debugging development settings. [CHAR LIMIT=25] --> <string name="debug_input_category">Input</string> <!-- Preference category for drawing debugging development settings. [CHAR LIMIT=25] --> <string name="debug_drawing_category">Drawing</string> <!-- Preference category for monitoring debugging development settings. [CHAR LIMIT=25] --> <string name="debug_monitoring_category">Monitoring</string> <!-- UI debug setting: always enable strict mode? [CHAR LIMIT=25] --> <string name="strict_mode">Strict mode enabled</string> Loading @@ -3589,20 +3595,32 @@ <!-- UI debug setting: show touches location summary [CHAR LIMIT=50] --> <string name="show_touches_summary">Show visual feedback for touches</string> <!-- UI debug setting: show where screen updates happen? [CHAR LIMIT=25] --> <string name="show_screen_updates">Show screen updates</string> <!-- UI debug setting: show screen updates summary [CHAR LIMIT=50] --> <string name="show_screen_updates_summary">Flash areas of screen when they update</string> <!-- UI debug setting: show where surface updates happen? [CHAR LIMIT=25] --> <string name="show_screen_updates">Show surface updates</string> <!-- UI debug setting: show surface updates summary [CHAR LIMIT=50] --> <string name="show_screen_updates_summary">Flash entire window surfaces when they update</string> <!-- UI debug setting: show where screen updates happen with GPU rendering? [CHAR LIMIT=25] --> <string name="show_hw_screen_updates">Show GPU screen updates</string> <!-- UI debug setting: show where window updates happen with GPU rendering? [CHAR LIMIT=25] --> <string name="show_hw_screen_updates">Show GPU view updates</string> <!-- UI debug setting: show GPU rendering screen updates summary [CHAR LIMIT=50] --> <string name="show_hw_screen_updates_summary">Flash areas of screen when they update with the GPU</string> <string name="show_hw_screen_updates_summary">Flash views inside windows when drawn with the GPU</string> <!-- UI debug setting: disable use of overlays? [CHAR LIMIT=25] --> <string name="disable_overlays">Disable overlays</string> <string name="disable_overlays">Disable HW overlays</string> <!-- UI debug setting: disable use of overlays summary [CHAR LIMIT=50] --> <string name="disable_overlays_summary">Don\'t use overlays for screen compositing</string> <string name="disable_overlays_summary">Always use GPU for screen compositing</string> <!-- UI debug setting: enable low-level traces? [CHAR LIMIT=25] --> <string name="enable_traces_title">Enable traces</string> <!-- UI debug setting: title for dialog to enable low-level traces [CHAR LIMIT=25] --> <string name="enable_traces_dialog_title">Select enabled traces</string> <!-- UI debug setting: enable low-level traces, none enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_none">No traces currently enabled</string> <!-- UI debug setting: enable low-level traces, some number enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_num"><xliff:g id="num">%1$d</xliff:g> traces currently enabled</string> <!-- UI debug setting: enable low-level traces, all enabled summary [CHAR LIMIT=NONE] --> <string name="enable_traces_summary_all">All traces currently enabled</string> <!-- UI debug setting: show layout bounds information [CHAR LIMIT=25] --> <string name="debug_layout">Show layout bounds</string> Loading @@ -3617,7 +3635,7 @@ <!-- UI debug setting: force hardware acceleration to render apps [CHAR LIMIT=25] --> <string name="force_hw_ui">Force GPU rendering</string> <!-- UI debug setting: force hardware acceleration summary [CHAR LIMIT=50] --> <string name="force_hw_ui_summary">Use 2D hardware acceleration in applications</string> <string name="force_hw_ui_summary">Force use of GPU for 2d drawing</string> <!-- UI debug setting: profile time taken by hardware acceleration to render apps [CHAR LIMIT=25] --> <string name="track_frame_time">Profile GPU rendering</string> Loading
res/xml/development_prefs.xml +47 −32 Original line number Diff line number Diff line Loading @@ -62,58 +62,38 @@ </PreferenceCategory> <PreferenceCategory android:key="debug_ui_category" android:title="@string/debug_ui_category"> <PreferenceCategory android:key="debug_input_category" android:title="@string/debug_input_category"> <CheckBoxPreference android:key="strict_mode" android:title="@string/strict_mode" android:summary="@string/strict_mode_summary"/> android:key="show_touches" android:title="@string/show_touches" android:summary="@string/show_touches_summary"/> <CheckBoxPreference android:key="pointer_location" android:title="@string/pointer_location" android:summary="@string/pointer_location_summary"/> <CheckBoxPreference android:key="show_touches" android:title="@string/show_touches" android:summary="@string/show_touches_summary"/> </PreferenceCategory> <PreferenceCategory android:key="debug_drawing_category" android:title="@string/debug_drawing_category"> <CheckBoxPreference android:key="debug_layout" android:title="@string/debug_layout" android:summary="@string/debug_layout_summary"/> <CheckBoxPreference android:key="show_screen_updates" android:title="@string/show_screen_updates" android:summary="@string/show_screen_updates_summary"/> <CheckBoxPreference android:key="disable_overlays" android:title="@string/disable_overlays" android:summary="@string/disable_overlays_summary"/> <CheckBoxPreference android:key="show_cpu_usage" android:title="@string/show_cpu_usage" android:summary="@string/show_cpu_usage_summary"/> <CheckBoxPreference android:key="force_hw_ui" android:title="@string/force_hw_ui" android:summary="@string/force_hw_ui_summary"/> <CheckBoxPreference android:key="show_hw_screen_udpates" android:title="@string/show_hw_screen_updates" android:summary="@string/show_hw_screen_updates_summary"/> <CheckBoxPreference android:key="track_frame_time" android:title="@string/track_frame_time" android:summary="@string/track_frame_time_summary"/> android:key="show_screen_updates" android:title="@string/show_screen_updates" android:summary="@string/show_screen_updates_summary"/> <ListPreference android:key="window_animation_scale" Loading @@ -136,6 +116,41 @@ android:entries="@array/animator_duration_scale_entries" android:entryValues="@array/animator_duration_scale_values" /> <CheckBoxPreference android:key="disable_overlays" android:title="@string/disable_overlays" android:summary="@string/disable_overlays_summary"/> <CheckBoxPreference android:key="force_hw_ui" android:title="@string/force_hw_ui" android:summary="@string/force_hw_ui_summary"/> </PreferenceCategory> <PreferenceCategory android:key="debug_monitoring_category" android:title="@string/debug_monitoring_category"> <CheckBoxPreference android:key="strict_mode" android:title="@string/strict_mode" android:summary="@string/strict_mode_summary"/> <CheckBoxPreference android:key="show_cpu_usage" android:title="@string/show_cpu_usage" android:summary="@string/show_cpu_usage_summary"/> <CheckBoxPreference android:key="track_frame_time" android:title="@string/track_frame_time" android:summary="@string/track_frame_time_summary"/> <MultiCheckPreference android:key="enable_traces" android:title="@string/enable_traces_title" android:dialogTitle="@string/enable_traces_dialog_title" /> </PreferenceCategory> <PreferenceCategory android:key="debug_applications_category" Loading
src/com/android/settings/DevelopmentSettings.java +102 −16 Original line number Diff line number Diff line Loading @@ -39,8 +39,10 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.os.StrictMode; import android.os.SystemProperties; import android.os.Trace; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.MultiCheckPreference; import android.preference.Preference; import android.preference.PreferenceFragment; import android.preference.PreferenceScreen; Loading Loading @@ -85,6 +87,8 @@ public class DevelopmentSettings extends PreferenceFragment private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale"; private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale"; private static final String ENABLE_TRACES_KEY = "enable_traces"; private static final String IMMEDIATELY_DESTROY_ACTIVITIES_KEY = "immediately_destroy_activities"; private static final String APP_PROCESS_LIMIT_KEY = "app_process_limit"; Loading @@ -98,6 +102,7 @@ public class DevelopmentSettings extends PreferenceFragment private Switch mEnabledSwitch; private boolean mLastEnabledState; private boolean mHaveDebugSettings; private CheckBoxPreference mEnableAdb; private CheckBoxPreference mKeepScreenOn; Loading @@ -121,6 +126,7 @@ public class DevelopmentSettings extends PreferenceFragment private ListPreference mWindowAnimationScale; private ListPreference mTransitionAnimationScale; private ListPreference mAnimatorDurationScale; private MultiCheckPreference mEnableTracesPref; private CheckBoxPreference mImmediatelyDestroyActivities; private ListPreference mAppProcessLimit; Loading Loading @@ -174,6 +180,15 @@ public class DevelopmentSettings extends PreferenceFragment mAnimatorDurationScale = (ListPreference) findPreference(ANIMATOR_DURATION_SCALE_KEY); mAllPrefs.add(mAnimatorDurationScale); mAnimatorDurationScale.setOnPreferenceChangeListener(this); mEnableTracesPref = (MultiCheckPreference)findPreference(ENABLE_TRACES_KEY); String[] traceValues = new String[Trace.TRACE_TAGS.length]; for (int i=Trace.TRACE_FLAGS_START_BIT; i<traceValues.length; i++) { traceValues[i] = Integer.toString(1<<i); } mEnableTracesPref.setEntries(Trace.TRACE_TAGS); mEnableTracesPref.setEntryValues(traceValues); mAllPrefs.add(mEnableTracesPref); mEnableTracesPref.setOnPreferenceChangeListener(this); mImmediatelyDestroyActivities = (CheckBoxPreference) findPreference( IMMEDIATELY_DESTROY_ACTIVITIES_KEY); Loading Loading @@ -265,15 +280,32 @@ public class DevelopmentSettings extends PreferenceFragment Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; mEnabledSwitch.setChecked(mLastEnabledState); setPrefsEnabledState(mLastEnabledState); if (mHaveDebugSettings && !mLastEnabledState) { // Overall debugging is disabled, but there are some debug // settings that are enabled. This is an invalid state. Switch // to debug settings being enabled, so the user knows there is // stuff enabled and can turn it all off if they want. Settings.Secure.putInt(getActivity().getContentResolver(), Settings.Secure.DEVELOPMENT_SETTINGS_ENABLED, 1); mLastEnabledState = true; setPrefsEnabledState(mLastEnabledState); } } void updateCheckBox(CheckBoxPreference checkBox, boolean value) { checkBox.setChecked(value); mHaveDebugSettings |= value; } private void updateAllOptions() { final ContentResolver cr = getActivity().getContentResolver(); mEnableAdb.setChecked(Settings.Secure.getInt(cr, mHaveDebugSettings = false; updateCheckBox(mEnableAdb, Settings.Secure.getInt(cr, Settings.Secure.ADB_ENABLED, 0) != 0); mKeepScreenOn.setChecked(Settings.System.getInt(cr, updateCheckBox(mKeepScreenOn, Settings.System.getInt(cr, Settings.System.STAY_ON_WHILE_PLUGGED_IN, 0) != 0); mAllowMockLocation.setChecked(Settings.Secure.getInt(cr, updateCheckBox(mAllowMockLocation, Settings.Secure.getInt(cr, Settings.Secure.ALLOW_MOCK_LOCATION, 0) != 0); updateHdcpValues(); updatePasswordSummary(); Loading @@ -288,6 +320,7 @@ public class DevelopmentSettings extends PreferenceFragment updateShowHwScreenUpdatesOptions(); updateDebugLayoutOptions(); updateAnimationScaleOptions(); updateEnableTracesOptions(); updateImmediatelyDestroyActivitiesOptions(); updateAppProcessLimitOptions(); updateShowAllANRsOptions(); Loading @@ -305,7 +338,9 @@ public class DevelopmentSettings extends PreferenceFragment writeAnimationScaleOption(0, mWindowAnimationScale, null); writeAnimationScaleOption(1, mTransitionAnimationScale, null); writeAnimationScaleOption(2, mAnimatorDurationScale, null); writeEnableTracesOptions(0); writeAppProcessLimitOptions(null); mHaveDebugSettings = false; updateAllOptions(); } Loading Loading @@ -359,7 +394,7 @@ public class DevelopmentSettings extends PreferenceFragment private void updateDebuggerOptions() { mDebugApp = Settings.System.getString( getActivity().getContentResolver(), Settings.System.DEBUG_APP); mWaitForDebugger.setChecked(Settings.System.getInt( updateCheckBox(mWaitForDebugger, Settings.System.getInt( getActivity().getContentResolver(), Settings.System.WAIT_FOR_DEBUGGER, 0) != 0); if (mDebugApp != null && mDebugApp.length() > 0) { String label; Loading @@ -373,6 +408,7 @@ public class DevelopmentSettings extends PreferenceFragment } mDebugAppPref.setSummary(getResources().getString(R.string.debug_app_set, label)); mWaitForDebugger.setEnabled(true); mHaveDebugSettings = true; } else { mDebugAppPref.setSummary(getResources().getString(R.string.debug_app_not_set)); mWaitForDebugger.setEnabled(false); Loading Loading @@ -401,7 +437,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateStrictModeVisualOptions() { mStrictMode.setChecked(currentStrictModeActiveIndex() == 1); updateCheckBox(mStrictMode, currentStrictModeActiveIndex() == 1); } private void writePointerLocationOptions() { Loading @@ -410,7 +446,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updatePointerLocationOptions() { mPointerLocation.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mPointerLocation, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.POINTER_LOCATION, 0) != 0); } Loading @@ -420,7 +456,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowTouchesOptions() { mShowTouches.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mShowTouches, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.SHOW_TOUCHES, 0) != 0); } Loading @@ -438,11 +474,11 @@ public class DevelopmentSettings extends PreferenceFragment @SuppressWarnings("unused") int enableGL = reply.readInt(); int showUpdates = reply.readInt(); mShowScreenUpdates.setChecked(showUpdates != 0); updateCheckBox(mShowScreenUpdates, showUpdates != 0); @SuppressWarnings("unused") int showBackground = reply.readInt(); int disableOverlays = reply.readInt(); mDisableOverlays.setChecked(disableOverlays != 0); updateCheckBox(mDisableOverlays, disableOverlays != 0); reply.recycle(); data.recycle(); } Loading Loading @@ -485,7 +521,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateHardwareUiOptions() { mForceHardwareUi.setChecked(SystemProperties.getBoolean(HARDWARE_UI_PROPERTY, false)); updateCheckBox(mForceHardwareUi, SystemProperties.getBoolean(HARDWARE_UI_PROPERTY, false)); } private void writeHardwareUiOptions() { Loading @@ -493,7 +529,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateTrackFrameTimeOptions() { mTrackFrameTime.setChecked( updateCheckBox(mTrackFrameTime, SystemProperties.getBoolean(HardwareRenderer.PROFILE_PROPERTY, false)); } Loading @@ -503,7 +539,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowHwScreenUpdatesOptions() { mShowHwScreenUpdates.setChecked( updateCheckBox(mShowHwScreenUpdates, SystemProperties.getBoolean(HardwareRenderer.DEBUG_DIRTY_REGIONS_PROPERTY, false)); } Loading @@ -513,7 +549,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateDebugLayoutOptions() { mDebugLayout.setChecked( updateCheckBox(mDebugLayout, SystemProperties.getBoolean(View.DEBUG_LAYOUT_PROPERTY, false)); } Loading @@ -523,7 +559,7 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateCpuUsageOptions() { mShowCpuUsage.setChecked(Settings.System.getInt(getActivity().getContentResolver(), updateCheckBox(mShowCpuUsage, Settings.System.getInt(getActivity().getContentResolver(), Settings.System.SHOW_PROCESSES, 0) != 0); } Loading @@ -549,13 +585,16 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateImmediatelyDestroyActivitiesOptions() { mImmediatelyDestroyActivities.setChecked(Settings.System.getInt( updateCheckBox(mImmediatelyDestroyActivities, Settings.System.getInt( getActivity().getContentResolver(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0) != 0); } private void updateAnimationScaleValue(int which, ListPreference pref) { try { float scale = mWindowManager.getAnimationScale(which); if (scale != 1) { mHaveDebugSettings = true; } CharSequence[] values = pref.getEntryValues(); for (int i=0; i<values.length; i++) { float val = Float.parseFloat(values[i].toString()); Loading Loading @@ -593,6 +632,9 @@ public class DevelopmentSettings extends PreferenceFragment for (int i=0; i<values.length; i++) { int val = Integer.parseInt(values[i].toString()); if (val >= limit) { if (i != 0) { mHaveDebugSettings = true; } mAppProcessLimit.setValueIndex(i); mAppProcessLimit.setSummary(mAppProcessLimit.getEntries()[i]); return; Loading Loading @@ -620,10 +662,51 @@ public class DevelopmentSettings extends PreferenceFragment } private void updateShowAllANRsOptions() { mShowAllANRs.setChecked(Settings.Secure.getInt( updateCheckBox(mShowAllANRs, Settings.Secure.getInt( getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0); } private void updateEnableTracesOptions() { String strValue = SystemProperties.get(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS); long flags = SystemProperties.getLong(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, 0); String[] values = mEnableTracesPref.getEntryValues(); int numSet = 0; for (int i=Trace.TRACE_FLAGS_START_BIT; i<values.length; i++) { boolean set = (flags&(1<<i)) != 0; mEnableTracesPref.setValue(i-Trace.TRACE_FLAGS_START_BIT, set); if (set) { numSet++; } } if (numSet == 0) { mEnableTracesPref.setSummary(R.string.enable_traces_summary_none); } else if (numSet == values.length) { mHaveDebugSettings = true; mEnableTracesPref.setSummary(R.string.enable_traces_summary_all); } else { mHaveDebugSettings = true; mEnableTracesPref.setSummary(getString(R.string.enable_traces_summary_num, numSet)); } } private void writeEnableTracesOptions() { long value = 0; String[] values = mEnableTracesPref.getEntryValues(); for (int i=Trace.TRACE_FLAGS_START_BIT; i<values.length; i++) { if (mEnableTracesPref.getValue(i-Trace.TRACE_FLAGS_START_BIT)) { value |= 1<<i; } } writeEnableTracesOptions(value); // Make sure summary is updated. updateEnableTracesOptions(); } private void writeEnableTracesOptions(long value) { SystemProperties.set(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, "0x" + Long.toString(value, 16)); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView == mEnabledSwitch) { Loading Loading @@ -744,6 +827,9 @@ public class DevelopmentSettings extends PreferenceFragment } else if (preference == mAnimatorDurationScale) { writeAnimationScaleOption(2, mAnimatorDurationScale, newValue); return true; } else if (preference == mEnableTracesPref) { writeEnableTracesOptions(); return true; } else if (preference == mAppProcessLimit) { writeAppProcessLimitOptions(newValue); return true; Loading