Merge "Add a flag to the API to specify -O0 on the bcc command line."
diff --git a/Android.mk b/Android.mk
index e2eabed..c12f74a 100644
--- a/Android.mk
+++ b/Android.mk
@@ -731,7 +731,8 @@
 	$(foreach lib,$(FRAMEWORKS_SUPPORT_JAVA_LIBRARIES),$(call intermediates-dir-for,JAVA_LIBRARIES,$(lib)-res,,COMMON))
 
 framework_docs_LOCAL_ADDITIONAL_DEPENDENCIES := \
-    frameworks/base/docs/knowntags.txt
+    frameworks/base/docs/knowntags.txt \
+    libcore/Docs.mk
 
 samples_dir := development/samples/browseable
 
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 73913b6..71b365d 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -19,6 +19,7 @@
 import android.animation.Animator;
 import android.animation.StateListAnimator;
 import android.annotation.NonNull;
+import android.icu.text.PluralRules;
 import android.util.Pools.SynchronizedPool;
 import android.view.ViewDebug;
 import com.android.internal.util.XmlUtils;
@@ -49,8 +50,6 @@
 import java.lang.ref.WeakReference;
 import java.util.Locale;
 
-import libcore.icu.NativePluralRules;
-
 /**
  * Class for accessing an application's resources.  This sits on top of the
  * asset manager of the application (accessible through {@link #getAssets}) and
@@ -136,7 +135,7 @@
     final DisplayMetrics mMetrics = new DisplayMetrics();
 
     private final Configuration mConfiguration = new Configuration();
-    private NativePluralRules mPluralRule;
+    private PluralRules mPluralRule;
 
     private CompatibilityInfo mCompatibilityInfo = CompatibilityInfo.DEFAULT_COMPATIBILITY_INFO;
 
@@ -321,9 +320,9 @@
      *         possibly styled text information.
      */
     public CharSequence getQuantityText(int id, int quantity) throws NotFoundException {
-        NativePluralRules rule = getPluralRule();
+        PluralRules rule = getPluralRule();
         CharSequence res = mAssets.getResourceBagText(id,
-                attrForQuantityCode(rule.quantityForInt(quantity)));
+                attrForQuantityCode(rule.select(quantity)));
         if (res != null) {
             return res;
         }
@@ -333,40 +332,29 @@
         }
         throw new NotFoundException("Plural resource ID #0x" + Integer.toHexString(id)
                 + " quantity=" + quantity
-                + " item=" + stringForQuantityCode(rule.quantityForInt(quantity)));
+                + " item=" + rule.select(quantity));
     }
 
-    private NativePluralRules getPluralRule() {
+    private PluralRules getPluralRule() {
         synchronized (sSync) {
             if (mPluralRule == null) {
-                mPluralRule = NativePluralRules.forLocale(mConfiguration.locale);
+                mPluralRule = PluralRules.forLocale(mConfiguration.locale);
             }
             return mPluralRule;
         }
     }
 
-    private static int attrForQuantityCode(int quantityCode) {
+    private static int attrForQuantityCode(String quantityCode) {
         switch (quantityCode) {
-            case NativePluralRules.ZERO: return 0x01000005;
-            case NativePluralRules.ONE:  return 0x01000006;
-            case NativePluralRules.TWO:  return 0x01000007;
-            case NativePluralRules.FEW:  return 0x01000008;
-            case NativePluralRules.MANY: return 0x01000009;
+            case PluralRules.KEYWORD_ZERO: return 0x01000005;
+            case PluralRules.KEYWORD_ONE:  return 0x01000006;
+            case PluralRules.KEYWORD_TWO:  return 0x01000007;
+            case PluralRules.KEYWORD_FEW:  return 0x01000008;
+            case PluralRules.KEYWORD_MANY: return 0x01000009;
             default:                     return ID_OTHER;
         }
     }
 
-    private static String stringForQuantityCode(int quantityCode) {
-        switch (quantityCode) {
-            case NativePluralRules.ZERO: return "zero";
-            case NativePluralRules.ONE:  return "one";
-            case NativePluralRules.TWO:  return "two";
-            case NativePluralRules.FEW:  return "few";
-            case NativePluralRules.MANY: return "many";
-            default:                     return "other";
-        }
-    }
-
     /**
      * Return the string value associated with a particular resource ID.  It
      * will be stripped of any styled text information.
@@ -1852,7 +1840,7 @@
         }
         synchronized (sSync) {
             if (mPluralRule != null) {
-                mPluralRule = NativePluralRules.forLocale(config.locale);
+                mPluralRule = PluralRules.forLocale(config.locale);
             }
         }
     }
diff --git a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
index 8fd56d7..b837fbe 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java
@@ -1554,7 +1554,7 @@
 
 
     /**
-     * 8-bit GEMM-like operation for neural networks: C = B.transposed() * A
+     * 8-bit GEMM-like operation for neural networks: C = A * Transpose(B)
      * Calculations are done in 1.10.21 fixed-point format for the final output,
      * just before there's a shift down to drop the fractional parts. The output
      * values are gated to 0 to 255 to fit in a byte, but the 10-bit format
diff --git a/services/core/java/com/android/server/am/NativeCrashListener.java b/services/core/java/com/android/server/am/NativeCrashListener.java
index ca0d578..d0973d5 100644
--- a/services/core/java/com/android/server/am/NativeCrashListener.java
+++ b/services/core/java/com/android/server/am/NativeCrashListener.java
@@ -123,11 +123,10 @@
             Os.listen(serverFd, 1);
 
             while (true) {
-                InetSocketAddress peer = new InetSocketAddress();
                 FileDescriptor peerFd = null;
                 try {
                     if (MORE_DEBUG) Slog.v(TAG, "Waiting for debuggerd connection");
-                    peerFd = Os.accept(serverFd, peer);
+                    peerFd = Os.accept(serverFd, null /* peerAddress */);
                     if (MORE_DEBUG) Slog.v(TAG, "Got debuggerd socket " + peerFd);
                     if (peerFd != null) {
                         // Only the superuser is allowed to talk to us over this socket