diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index 0ad6a91..80e756e 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -482,10 +482,10 @@
     }
 
     private void updateDebuggerOptions() {
-        mDebugApp = Settings.System.getString(
-                getActivity().getContentResolver(), Settings.System.DEBUG_APP);
-        updateCheckBox(mWaitForDebugger, Settings.System.getInt(
-                getActivity().getContentResolver(), Settings.System.WAIT_FOR_DEBUGGER, 0) != 0);
+        mDebugApp = Settings.Global.getString(
+                getActivity().getContentResolver(), Settings.Global.DEBUG_APP);
+        updateCheckBox(mWaitForDebugger, Settings.Global.getInt(
+                getActivity().getContentResolver(), Settings.Global.WAIT_FOR_DEBUGGER, 0) != 0);
         if (mDebugApp != null && mDebugApp.length() > 0) {
             String label;
             try {
@@ -720,14 +720,14 @@
     }
 
     private void updateCpuUsageOptions() {
-        updateCheckBox(mShowCpuUsage, Settings.System.getInt(getActivity().getContentResolver(),
-                Settings.System.SHOW_PROCESSES, 0) != 0);
+        updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(),
+                Settings.Global.SHOW_PROCESSES, 0) != 0);
     }
     
     private void writeCpuUsageOptions() {
         boolean value = mShowCpuUsage.isChecked();
-        Settings.System.putInt(getActivity().getContentResolver(),
-                Settings.System.SHOW_PROCESSES, value ? 1 : 0);
+        Settings.Global.putInt(getActivity().getContentResolver(),
+                Settings.Global.SHOW_PROCESSES, value ? 1 : 0);
         Intent service = (new Intent())
                 .setClassName("com.android.systemui", "com.android.systemui.LoadAverageService");
         if (value) {
@@ -746,8 +746,8 @@
     }
 
     private void updateImmediatelyDestroyActivitiesOptions() {
-        updateCheckBox(mImmediatelyDestroyActivities, Settings.System.getInt(
-            getActivity().getContentResolver(), Settings.System.ALWAYS_FINISH_ACTIVITIES, 0) != 0);
+        updateCheckBox(mImmediatelyDestroyActivities, Settings.Global.getInt(
+            getActivity().getContentResolver(), Settings.Global.ALWAYS_FINISH_ACTIVITIES, 0) != 0);
     }
 
     private void updateAnimationScaleValue(int which, ListPreference pref) {
diff --git a/src/com/android/settings/SoundSettings.java b/src/com/android/settings/SoundSettings.java
index 587acab..14a1083 100644
--- a/src/com/android/settings/SoundSettings.java
+++ b/src/com/android/settings/SoundSettings.java
@@ -315,7 +315,7 @@
                 getActivity().sendBroadcast(i);
             }
         } else if (preference == mDockSounds) {
-            Settings.System.putInt(getContentResolver(), Settings.System.DOCK_SOUNDS_ENABLED,
+            Settings.Global.putInt(getContentResolver(), Settings.Global.DOCK_SOUNDS_ENABLED,
                     mDockSounds.isChecked() ? 1 : 0);
         }
         return true;
@@ -354,8 +354,8 @@
 
             mDockSounds = (CheckBoxPreference) findPreference(KEY_DOCK_SOUNDS);
             mDockSounds.setPersistent(false);
-            mDockSounds.setChecked(Settings.System.getInt(resolver,
-                    Settings.System.DOCK_SOUNDS_ENABLED, 0) != 0);
+            mDockSounds.setChecked(Settings.Global.getInt(resolver,
+                    Settings.Global.DOCK_SOUNDS_ENABLED, 0) != 0);
         } else {
             getPreferenceScreen().removePreference(findPreference(KEY_DOCK_CATEGORY));
             getPreferenceScreen().removePreference(findPreference(KEY_AUDIO_SETTINGS));
diff --git a/src/com/android/settings/bluetooth/BluetoothEnabler.java b/src/com/android/settings/bluetooth/BluetoothEnabler.java
index f08e083..7ef0695 100644
--- a/src/com/android/settings/bluetooth/BluetoothEnabler.java
+++ b/src/com/android/settings/bluetooth/BluetoothEnabler.java
@@ -103,7 +103,7 @@
     public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
         // Show toast message if Bluetooth is not allowed in airplane mode
         if (isChecked &&
-                !WirelessSettings.isRadioAllowed(mContext, Settings.System.RADIO_BLUETOOTH)) {
+                !WirelessSettings.isRadioAllowed(mContext, Settings.Global.RADIO_BLUETOOTH)) {
             Toast.makeText(mContext, R.string.wifi_in_airplane_mode, Toast.LENGTH_SHORT).show();
             // Reset switch to off
             buttonView.setChecked(false);
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 987294b..641a7ab 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -104,7 +104,7 @@
             return;
         }
         // Show toast message if Wi-Fi is not allowed in airplane mode
-        if (isChecked && !WirelessSettings.isRadioAllowed(mContext, Settings.System.RADIO_WIFI)) {
+        if (isChecked && !WirelessSettings.isRadioAllowed(mContext, Settings.Global.RADIO_WIFI)) {
             Toast.makeText(mContext, R.string.wifi_in_airplane_mode, Toast.LENGTH_SHORT).show();
             // Reset switch to off. No infinite check/listenenr loop.
             buttonView.setChecked(false);
