am eaf1b227: Reconcile with jb-release

* commit 'eaf1b2279ad634054673047cf5d04de211b1a011':
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 5326009..9abc3b7 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -11,8 +11,8 @@
     <string name="touch" msgid="4727218133711188355">"Tocar para transmitir"</string>
     <string name="beam_progress" msgid="7453634884807323920">"Transmisión entrante..."</string>
     <string name="beam_complete" msgid="477026736424637435">"Transmisión completa"</string>
-    <string name="beam_failed" msgid="5116241718189888630">"La transmisión no se completó"</string>
-    <string name="beam_canceled" msgid="5425192751826544741">"Transmisión cancelada"</string>
+    <string name="beam_failed" msgid="5116241718189888630">"La transferencia no se completó"</string>
+    <string name="beam_canceled" msgid="5425192751826544741">"Transferencia cancelada"</string>
     <string name="cancel" msgid="61873902552555096">"Cancelar"</string>
     <string name="beam_touch_to_view" msgid="7853129156831642630">"Toca para ver"</string>
     <string name="beam_handover_not_supported" msgid="4083165921751489015">"El dispositivo del receptor no admite la transferencia de archivos de gran tamaño."</string>
@@ -22,8 +22,8 @@
     <string name="disconnecting_headset" msgid="868262189044372780">"Desconectando..."</string>
     <string name="disconnected_headset" msgid="4066109452701733916">"Desconectados"</string>
     <string name="pairing_headset" msgid="6443461444755646137">"Sincronizando..."</string>
-    <string name="pairing_headset_failed" msgid="6509629663883514688">"No se pudo sincronizar"</string>
-    <string name="failed_to_enable_bt" msgid="7229153323594758077">"Error al activar Bluetooth"</string>
+    <string name="pairing_headset_failed" msgid="6509629663883514688">"No se pudo vincular"</string>
+    <string name="failed_to_enable_bt" msgid="7229153323594758077">"Error al habilitar Bluetooth"</string>
     <string name="confirm_pairing" msgid="4112568077038265363">"¿Realmente deseas sincronizar el dispositivo Bluetooth <xliff:g id="DEVICE_NAME">%1$s</xliff:g>?"</string>
     <string name="pair_yes" msgid="3525614878559994448">"Sí"</string>
     <string name="pair_no" msgid="5022308368904055020">"No"</string>
diff --git a/res/values-ms/strings.xml b/res/values-ms/strings.xml
index 7e53ff3..8f3b659 100644
--- a/res/values-ms/strings.xml
+++ b/res/values-ms/strings.xml
@@ -15,15 +15,16 @@
     <string name="beam_canceled" msgid="5425192751826544741">"Pancar dibatalkan"</string>
     <string name="cancel" msgid="61873902552555096">"Batal"</string>
     <string name="beam_touch_to_view" msgid="7853129156831642630">"Sentuh untuk melihat"</string>
-    <string name="beam_handover_not_supported" msgid="4083165921751489015">"Peranti penerima tidak menyokong pemindahan fail besar melalui pancaran."</string>
+    <!-- no translation found for beam_handover_not_supported (4083165921751489015) -->
+    <skip />
     <string name="connecting_headset" msgid="3929250919225573008">"Menyambung"</string>
     <string name="connected_headset" msgid="4047751837023241955">"Disambungkan"</string>
-    <string name="connect_headset_failed" msgid="7500801585498094863">"Tidak dapat menyambung"</string>
+    <string name="connect_headset_failed" msgid="7500801585498094863">"Tidak boleh menyambung"</string>
     <string name="disconnecting_headset" msgid="868262189044372780">"Memutuskan sambungan"</string>
     <string name="disconnected_headset" msgid="4066109452701733916">"Diputuskan sambungan"</string>
     <string name="pairing_headset" msgid="6443461444755646137">"Menjadikan pasangan"</string>
-    <string name="pairing_headset_failed" msgid="6509629663883514688">"Tidak dapat berpasangan"</string>
-    <string name="failed_to_enable_bt" msgid="7229153323594758077">"Tidak dapat mendayakan Bluetooth"</string>
+    <string name="pairing_headset_failed" msgid="6509629663883514688">"Tidak boleh berpasangan"</string>
+    <string name="failed_to_enable_bt" msgid="7229153323594758077">"Tidak boleh mendayakan Bluetooth"</string>
     <string name="confirm_pairing" msgid="4112568077038265363">"Adakah anda pasti anda mahu memadankan peranti Bluetooth <xliff:g id="DEVICE_NAME">%1$s</xliff:g>?"</string>
     <string name="pair_yes" msgid="3525614878559994448">"Ya"</string>
     <string name="pair_no" msgid="5022308368904055020">"Tidak"</string>
diff --git a/src/com/android/nfc/P2pEventManager.java b/src/com/android/nfc/P2pEventManager.java
index c024afc..68f479b 100644
--- a/src/com/android/nfc/P2pEventManager.java
+++ b/src/com/android/nfc/P2pEventManager.java
@@ -51,7 +51,16 @@
                 Context.NOTIFICATION_SERVICE);
 
         mSending = false;
-        mSendUi = new SendUi(context, this);
+        final int uiModeType = mContext.getResources().getConfiguration().uiMode
+                & Configuration.UI_MODE_TYPE_MASK;
+        if (uiModeType == Configuration.UI_MODE_TYPE_APPLIANCE) {
+            // "Appliances" don't intrinsically have a way of confirming this, so we
+            // don't use the UI and just autoconfirm where necessary.
+            // Don't instantiate SendUi or else we'll use memory and never reclaim it.
+            mSendUi = null;
+        } else {
+            mSendUi = new SendUi(context, this);
+        }
     }
 
     @Override
@@ -61,19 +70,17 @@
         mNdefReceived = false;
 
         mVibrator.vibrate(VIBRATION_PATTERN, -1);
-        mSendUi.takeScreenshot();
+        if (mSendUi != null) {
+            mSendUi.takeScreenshot();
+        }
     }
 
     @Override
     public void onP2pSendConfirmationRequested() {
-        final int uiModeType = mContext.getResources().getConfiguration().uiMode
-                & Configuration.UI_MODE_TYPE_MASK;
-        if (uiModeType == Configuration.UI_MODE_TYPE_APPLIANCE) {
-            // "Appliances" don't intrinsically have a way of confirming this, so we
-            // will just auto-confirm.
-            mCallback.onP2pSendConfirmed();
-        } else {
+        if (mSendUi != null) {
             mSendUi.showPreSend();
+        } else {
+            mCallback.onP2pSendConfirmed();
         }
     }
 
@@ -81,7 +88,9 @@
     public void onP2pSendComplete() {
         mNfcService.playSound(NfcService.SOUND_END);
         mVibrator.vibrate(VIBRATION_PATTERN, -1);
-        mSendUi.finish(SendUi.FINISH_SEND_SUCCESS);
+        if (mSendUi != null) {
+            mSendUi.finish(SendUi.FINISH_SEND_SUCCESS);
+        }
         mSending = false;
         mNdefSent = true;
     }
@@ -100,14 +109,16 @@
     public void onP2pReceiveComplete(boolean playSound) {
         mVibrator.vibrate(VIBRATION_PATTERN, -1);
         if (playSound) mNfcService.playSound(NfcService.SOUND_END);
-        // TODO we still don't have a nice receive solution
-        // The sanest solution right now is just to scale back up what we had
-        // and start the new activity. It is not perfect, but at least it is
-        // consistent behavior. All other variants involve making the old
-        // activity screenshot disappear, and then removing the animation
-        // window hoping the new activity has started by then. This just goes
-        // wrong too often and can look weird.
-        mSendUi.finish(SendUi.FINISH_SCALE_UP);
+        if (mSendUi != null) {
+            // TODO we still don't have a nice receive solution
+            // The sanest solution right now is just to scale back up what we had
+            // and start the new activity. It is not perfect, but at least it is
+            // consistent behavior. All other variants involve making the old
+            // activity screenshot disappear, and then removing the animation
+            // window hoping the new activity has started by then. This just goes
+            // wrong too often and can look weird.
+            mSendUi.finish(SendUi.FINISH_SCALE_UP);
+        }
         mNdefReceived = true;
     }
 
@@ -117,7 +128,7 @@
             mNfcService.playSound(NfcService.SOUND_ERROR);
             mSending = false;
         }
-        if (!mNdefSent && !mNdefReceived) {
+        if (!mNdefSent && !mNdefReceived && mSendUi != null) {
             mSendUi.finish(SendUi.FINISH_SCALE_UP);
         }
     }
@@ -125,7 +136,9 @@
     @Override
     public void onSendConfirmed() {
         if (!mSending) {
-            mSendUi.showStartSend();
+            if (mSendUi != null) {
+                mSendUi.showStartSend();
+            }
             mCallback.onP2pSendConfirmed();
         }
         mSending = true;