@Override
 public boolean onPreferenceChange(Preference preference, Object newValue) {
   if (HDCP_CHECKING_KEY.equals(preference.getKey())) {
     SystemProperties.set(HDCP_CHECKING_PROPERTY, newValue.toString());
     updateHdcpValues();
     pokeSystemProperties();
     return true;
   } else if (preference == mWindowAnimationScale) {
     writeAnimationScaleOption(0, mWindowAnimationScale, newValue);
     return true;
   } else if (preference == mTransitionAnimationScale) {
     writeAnimationScaleOption(1, mTransitionAnimationScale, newValue);
     return true;
   } else if (preference == mAnimatorDurationScale) {
     writeAnimationScaleOption(2, mAnimatorDurationScale, newValue);
     return true;
   } else if (preference == mOverlayDisplayDevices) {
     writeOverlayDisplayDevicesOptions(newValue);
     return true;
   } else if (preference == mOpenGLTraces) {
     writeOpenGLTracesOptions(newValue);
     return true;
   } else if (preference == mEnableTracesPref) {
     writeEnableTracesOptions();
     return true;
   } else if (preference == mAppProcessLimit) {
     writeAppProcessLimitOptions(newValue);
     return true;
   }
   return false;
 }
 private void resetDangerousOptions() {
   mDontPokeProperties = true;
   for (int i = 0; i < mResetCbPrefs.size(); i++) {
     CheckBoxPreference cb = mResetCbPrefs.get(i);
     if (cb.isChecked()) {
       cb.setChecked(false);
       onPreferenceTreeClick(null, cb);
     }
   }
   resetDebuggerOptions();
   writeAnimationScaleOption(0, mWindowAnimationScale, null);
   writeAnimationScaleOption(1, mTransitionAnimationScale, null);
   writeAnimationScaleOption(2, mAnimatorDurationScale, null);
   writeOverlayDisplayDevicesOptions(null);
   writeEnableTracesOptions(0);
   writeAppProcessLimitOptions(null);
   mHaveDebugSettings = false;
   updateAllOptions();
   mDontPokeProperties = false;
   pokeSystemProperties();
 }
 private void writeEnableTracesOptions(long value) {
   SystemProperties.set(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, "0x" + Long.toString(value, 16));
   pokeSystemProperties();
 }
 private void writeOpenGLTracesOptions(Object newValue) {
   SystemProperties.set(OPENGL_TRACES_PROPERTY, newValue == null ? "" : newValue.toString());
   pokeSystemProperties();
   updateOpenGLTracesOptions();
 }
 private void writeDebugLayoutOptions() {
   SystemProperties.set(View.DEBUG_LAYOUT_PROPERTY, mDebugLayout.isChecked() ? "true" : "false");
   pokeSystemProperties();
 }
 private void writeShowHwOverdrawOptions() {
   SystemProperties.set(
       HardwareRenderer.DEBUG_SHOW_OVERDRAW_PROPERTY, mShowHwOverdraw.isChecked() ? "true" : null);
   pokeSystemProperties();
 }
 private void writeShowHwLayersUpdatesOptions() {
   SystemProperties.set(
       HardwareRenderer.DEBUG_SHOW_LAYERS_UPDATES_PROPERTY,
       mShowHwLayersUpdates.isChecked() ? "true" : null);
   pokeSystemProperties();
 }
 private void writeShowHwScreenUpdatesOptions() {
   SystemProperties.set(
       HardwareRenderer.DEBUG_DIRTY_REGIONS_PROPERTY,
       mShowHwScreenUpdates.isChecked() ? "true" : null);
   pokeSystemProperties();
 }
 private void writeTrackFrameTimeOptions() {
   SystemProperties.set(
       HardwareRenderer.PROFILE_PROPERTY, mTrackFrameTime.isChecked() ? "true" : "false");
   pokeSystemProperties();
 }
 private void writeMsaaOptions() {
   SystemProperties.set(MSAA_PROPERTY, mForceMsaa.isChecked() ? "true" : "false");
   pokeSystemProperties();
 }
 private void writeHardwareUiOptions() {
   SystemProperties.set(HARDWARE_UI_PROPERTY, mForceHardwareUi.isChecked() ? "true" : "false");
   pokeSystemProperties();
 }