public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
   if (DEBUG) {
     Log.d(TAG, "onCheckedChanged: Remember Settings = " + isChecked);
   }
   if (mDevice != null) {
     LocalBluetoothPreferences.saveDockAutoConnectSetting(
         DockService.this, mDevice.getAddress(), isChecked);
   } else {
     Settings.Global.putInt(
         getContentResolver(), Settings.Global.DOCK_AUDIO_MEDIA_ENABLED, isChecked ? 1 : 0);
   }
 }
        public void onClick(DialogInterface dialog, int which) {
          if (which == DialogInterface.BUTTON_POSITIVE) {
            if (mDevice != null) {
              if (!LocalBluetoothPreferences.hasDockAutoConnectSetting(
                  DockService.this, mDevice.getAddress())) {
                LocalBluetoothPreferences.saveDockAutoConnectSetting(
                    DockService.this, mDevice.getAddress(), true);
              }

              applyBtSettings(mDevice, mStartIdAssociatedWithDialog);
            } else if (mAudioMediaCheckbox != null) {
              Settings.Global.putInt(
                  getContentResolver(),
                  Settings.Global.DOCK_AUDIO_MEDIA_ENABLED,
                  mAudioMediaCheckbox.isChecked() ? 1 : 0);
            }
          }
        }