Merge "Import revised translations.  DO NOT MERGE" into ics-factoryrom
diff --git a/core/java/android/server/BluetoothAdapterStateMachine.java b/core/java/android/server/BluetoothAdapterStateMachine.java
index ac46ee2..d26364e 100644
--- a/core/java/android/server/BluetoothAdapterStateMachine.java
+++ b/core/java/android/server/BluetoothAdapterStateMachine.java
@@ -434,6 +434,10 @@
                         if (mPublicState == BluetoothAdapter.STATE_TURNING_OFF) {
                             transitionTo(mHotOff);
                             finishSwitchingOff();
+                            if (!mContext.getResources().getBoolean
+                            (com.android.internal.R.bool.config_bluetooth_adapter_quick_switch)) {
+                                deferMessage(obtainMessage(TURN_COLD));
+                            }
                         }
                     } else {
                         if (mPublicState != BluetoothAdapter.STATE_TURNING_ON) {
@@ -486,16 +490,6 @@
             }
             return retValue;
         }
-
-        private void finishSwitchingOff() {
-            mBluetoothService.finishDisable();
-            if (mContext.getResources().getBoolean
-                (com.android.internal.R.bool.config_bluetooth_adapter_quick_switch)) {
-                broadcastState(BluetoothAdapter.STATE_OFF);
-            } else {
-                deferMessage(obtainMessage(TURN_COLD));
-            }
-        }
     }
 
     private class BluetoothOn extends State {
@@ -656,12 +650,10 @@
                     //$FALL-THROUGH$ all devices are already disconnected
                 case ALL_DEVICES_DISCONNECTED:
                     removeMessages(DEVICES_DISCONNECT_TIMEOUT);
-                    mBluetoothService.finishDisable();
-                    broadcastState(BluetoothAdapter.STATE_OFF);
+                    finishSwitchingOff();
                     break;
                 case DEVICES_DISCONNECT_TIMEOUT:
-                    mBluetoothService.finishDisable();
-                    broadcastState(BluetoothAdapter.STATE_OFF);
+                    finishSwitchingOff();
                     Log.e(TAG, "Devices fail to disconnect, reseting...");
                     transitionTo(mHotOff);
                     deferMessage(obtainMessage(TURN_COLD));
@@ -695,6 +687,12 @@
         }
     }
 
+    private void finishSwitchingOff() {
+        mBluetoothService.finishDisable();
+        broadcastState(BluetoothAdapter.STATE_OFF);
+        mBluetoothService.cleanupAfterFinishDisable();
+    }
+
     private void shutoffBluetooth() {
         mBluetoothService.shutoffBluetooth();
         mEventLoop.stop();
diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java
index f0fb4e0..63da926 100755
--- a/core/java/android/server/BluetoothService.java
+++ b/core/java/android/server/BluetoothService.java
@@ -390,8 +390,7 @@
     }
 
     /**
-     * The Bluetooth has been turned off, but hot. Do bonding, profile,
-     * and internal cleanup
+     * The Bluetooth has been turned off, but hot. Do bonding, profile cleanup
      */
     synchronized void finishDisable() {
         // mark in progress bondings as cancelled
@@ -409,8 +408,17 @@
         Intent intent = new Intent(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED);
         intent.putExtra(BluetoothAdapter.EXTRA_SCAN_MODE, BluetoothAdapter.SCAN_MODE_NONE);
         mContext.sendBroadcast(intent, BLUETOOTH_PERM);
+    }
 
+    /**
+     * Local clean up after broadcasting STATE_OFF intent
+     */
+    synchronized void cleanupAfterFinishDisable() {
         mAdapterProperties.clear();
+
+        for (Integer srHandle : mServiceRecordToPid.keySet()) {
+            removeServiceRecordNative(srHandle);
+        }
         mServiceRecordToPid.clear();
 
         mProfilesConnected = 0;
@@ -1526,6 +1534,8 @@
     public void removeServiceRecord(int handle) {
         mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM,
                                                 "Need BLUETOOTH permission");
+        // Since this is a binder call check if Bluetooth is off
+        if (getBluetoothStateInternal() == BluetoothAdapter.STATE_OFF) return;
         Message message = mHandler.obtainMessage(MESSAGE_REMOVE_SERVICE_RECORD);
         message.obj = new Pair<Integer, Integer>(handle, Binder.getCallingPid());
         mHandler.sendMessage(message);
@@ -1533,8 +1543,7 @@
 
     private synchronized void checkAndRemoveRecord(int handle, int pid) {
         Pair<Integer, IBinder> pidPair = mServiceRecordToPid.get(handle);
-        Integer owner = pidPair.first;
-        if (owner != null && pid == owner.intValue()) {
+        if (pidPair != null && pid == pidPair.first) {
             if (DBG) Log.d(TAG, "Removing service record " +
                 Integer.toHexString(handle) + " for pid " + pid);
             mServiceRecordToPid.remove(handle);
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png b/core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png
index a94d1b9e..19c8eb2 100644
--- a/core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png
+++ b/core/res/res/drawable-hdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png b/core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png
index 36d766d..c79a245 100644
--- a/core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png
+++ b/core/res/res/drawable-hdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png b/core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png
index 1437798..862f33bf 100644
--- a/core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png
+++ b/core/res/res/drawable-mdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png b/core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png
index b718258..30df0a3 100644
--- a/core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png
+++ b/core/res/res/drawable-mdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png b/core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
index d545883..760ef2d 100644
--- a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
+++ b/core/res/res/drawable-xhdpi/ic_lockscreen_camera_activated.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png b/core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
index 8de7b84..093bc05 100644
--- a/core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
+++ b/core/res/res/drawable-xhdpi/ic_lockscreen_camera_normal.png
Binary files differ
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index ed66823..fdb4548 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -282,7 +282,7 @@
     PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
         @Override
         public void onSignalStrengthsChanged(SignalStrength signalStrength) {
-            if (DEBUG || CHATTY) {
+            if (DEBUG) {
                 Slog.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength + 
                     ((signalStrength == null) ? "" : (" level=" + signalStrength.getLevel())));
             }
@@ -323,13 +323,6 @@
             }
             mDataState = state;
             mDataNetType = networkType;
-            if (state < 0) {
-                // device without a data connection
-                if (CHATTY) {
-                    Slog.d(TAG, "clearing mSignalStrength");
-                }
-                mSignalStrength = null;
-            }
             updateDataNetType();
             updateDataIcon();
             refreshViews();
@@ -409,9 +402,6 @@
                 int iconLevel;
                 int[] iconList;
                 mLastSignalLevel = iconLevel = mSignalStrength.getLevel();
-                if (CHATTY) {
-                    Slog.d(TAG, "updateTelephonySignalStrength: signal level = " + iconLevel);
-                }
                 if (isCdma()) {
                     if (isCdmaEri()) {
                         iconList = TelephonyIcons.TELEPHONY_SIGNAL_STRENGTH_ROAMING[mInetCondition];
diff --git a/policy/src/com/android/internal/policy/impl/GlobalActions.java b/policy/src/com/android/internal/policy/impl/GlobalActions.java
index ec31028..8569143 100644
--- a/policy/src/com/android/internal/policy/impl/GlobalActions.java
+++ b/policy/src/com/android/internal/policy/impl/GlobalActions.java
@@ -118,18 +118,18 @@
      */
     private AlertDialog createDialog() {
         mSilentModeToggle = new ToggleAction(
-                R.drawable.ic_lock_silent_mode,
-                R.drawable.ic_lock_silent_mode_off,
+                R.drawable.ic_audio_vol_mute,
+                R.drawable.ic_audio_vol,
                 R.string.global_action_toggle_silent_mode,
                 R.string.global_action_silent_mode_on_status,
                 R.string.global_action_silent_mode_off_status) {
 
             void willCreate() {
-                // XXX: FIXME: switch to ic_lock_vibrate_mode when available
+                // XXX: FIXME: Add vibrate indicator when available
                 mEnabledIconResId = (Settings.System.getInt(mContext.getContentResolver(),
                         Settings.System.VIBRATE_IN_SILENT, 1) == 1)
-                    ? R.drawable.ic_lock_silent_mode_vibrate
-                    : R.drawable.ic_lock_silent_mode;
+                    ? R.drawable.ic_audio_vol_mute
+                    : R.drawable.ic_audio_vol_mute;
             }
 
             void onToggle(boolean on) {