Merge "MTP: Fix file descriptor leak in file editing extensions"
diff --git a/core/java/android/animation/AnimatorInflater.java b/core/java/android/animation/AnimatorInflater.java
index bcab66e..ed4036d 100644
--- a/core/java/android/animation/AnimatorInflater.java
+++ b/core/java/android/animation/AnimatorInflater.java
@@ -31,11 +31,11 @@
import java.util.ArrayList;
/**
- * This class is used to instantiate menu XML files into Animator objects.
+ * This class is used to instantiate animator XML files into Animator objects.
* <p>
- * For performance reasons, menu inflation relies heavily on pre-processing of
+ * For performance reasons, inflation relies heavily on pre-processing of
* XML files that is done at build time. Therefore, it is not currently possible
- * to use MenuInflater with an XmlPullParser over a plain XML file at runtime;
+ * to use this inflater with an XmlPullParser over a plain XML file at runtime;
* it only works with an XmlPullParser returned from a compiled resource (R.
* <em>something</em> file.)
*/
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index 328a55b..77c2d1b 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -2600,10 +2600,12 @@
* (1000, 1000) is the lower right point. The length and width of focus
* areas cannot be 0 or negative.
*
- * The weight ranges from 1 to 1000. The sum of the weights of all focus
- * areas must be 1000. Focus areas can partially overlap and the driver
- * will add the weights in the overlap region. But apps should not set
- * two focus areas that have identical coordinates.
+ * The weight must range from 1 to 1000. The weight should be
+ * interpreted as a per-pixel weight - all pixels in the area have the
+ * specified weight. This means a small area with the same weight as a
+ * larger area will have less influence on the focusing than the larger
+ * area. Focus areas can partially overlap and the driver will add the
+ * weights in the overlap region.
*
* A special case of all-zero single focus area means driver to decide
* the focus area. For example, the driver may use more signals to
@@ -2668,10 +2670,11 @@
* point. (1000, 1000) is the lower right point. The length and width of
* metering areas cannot be 0 or negative.
*
- * The weight ranges from 1 to 1000. The sum of the weights of all
- * metering areas must be 1000. Metering areas can partially overlap and
- * the driver will add the weights in the overlap region. But apps
- * should not set two metering areas that have identical coordinates.
+ * The weight must range from 1 to 1000, and represents a weight for
+ * every pixel in the area. This means that a large metering area with
+ * the same weight as a smaller area will have more effect in the
+ * metering result. Metering areas can partially overlap and the driver
+ * will add the weights in the overlap region.
*
* A special case of all-zero single metering area means driver to
* decide the metering area. For example, the driver may use more
diff --git a/include/camera/CameraParameters.h b/include/camera/CameraParameters.h
index e272839..db81721 100644
--- a/include/camera/CameraParameters.h
+++ b/include/camera/CameraParameters.h
@@ -265,11 +265,12 @@
// (-1000,-1000) is the upper left point. (1000, 1000) is the lower right
// point. The length and width of focus areas cannot be 0 or negative.
//
- // The fifth element is the weight. The weight ranges from 1 to 1000.
- // The sum of the weights of all focus areas must be 1000. Focus areas
- // can partially overlap and the driver will add the weights in the
- // overlap region. But apps should not set two focus areas that have
- // identical coordinates.
+ // The fifth element is the weight. Values for weight must range from 1 to
+ // 1000. The weight should be interpreted as a per-pixel weight - all
+ // pixels in the area have the specified weight. This means a small area
+ // with the same weight as a larger area will have less influence on the
+ // focusing than the larger area. Focus areas can partially overlap and the
+ // driver will add the weights in the overlap region.
//
// A special case of single focus area (0,0,0,0,0) means driver to decide
// the focus area. For example, the driver may use more signals to decide
@@ -327,10 +328,12 @@
// is the lower right point. The length and width of metering areas cannot
// be 0 or negative.
//
- // The weight ranges from 1 to 1000. The sum of the weights of all metering
- // areas must be 1000. Metering areas can partially overlap and the driver
- // will add the weights in the overlap region. But apps should not set two
- // metering areas that have identical coordinates.
+ // The fifth element is the weight. Values for weight must range from 1 to
+ // 1000. The weight should be interpreted as a per-pixel weight - all
+ // pixels in the area have the specified weight. This means a small area
+ // with the same weight as a larger area will have less influence on the
+ // metering than the larger area. Metering areas can partially overlap and
+ // the driver will add the weights in the overlap region.
//
// A special case of all-zero single metering area means driver to decide
// the metering area. For example, the driver may use more signals to decide
diff --git a/keystore/java/android/security/Credentials.java b/keystore/java/android/security/Credentials.java
index c650141..6b69b8a 100644
--- a/keystore/java/android/security/Credentials.java
+++ b/keystore/java/android/security/Credentials.java
@@ -31,6 +31,8 @@
public static final String INSTALL_ACTION = "android.credentials.INSTALL";
+ public static final String UNLOCK_ACTION = "com.android.credentials.UNLOCK";
+
/** Key prefix for CA certificates. */
public static final String CA_CERTIFICATE = "CACERT_";
@@ -69,7 +71,7 @@
public void unlock(Context context) {
try {
- Intent intent = new Intent("com.android.credentials.UNLOCK");
+ Intent intent = new Intent(UNLOCK_ACTION);
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.w(LOGTAG, e.toString());
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 7f28959..75f5a5f 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -897,7 +897,8 @@
void OpenGLRenderer::setupDrawColor(int color, int alpha) {
mColorA = alpha / 255.0f;
- // BUG on this next line? a is alpha divided by 255 *twice*
+ // Second divide of a by 255 is an optimization, allowing us to simply multiply
+ // the rgb values by a instead of also dividing by 255
const float a = mColorA / 255.0f;
mColorR = a * ((color >> 16) & 0xFF);
mColorG = a * ((color >> 8) & 0xFF);
@@ -908,6 +909,8 @@
void OpenGLRenderer::setupDrawAlpha8Color(int color, int alpha) {
mColorA = alpha / 255.0f;
+ // Double-divide of a by 255 is an optimization, allowing us to simply multiply
+ // the rgb values by a instead of also dividing by 255
const float a = mColorA / 255.0f;
mColorR = a * ((color >> 16) & 0xFF);
mColorG = a * ((color >> 8) & 0xFF);
diff --git a/libs/hwui/ProgramCache.h b/libs/hwui/ProgramCache.h
index cead75b..9a7a2d2 100644
--- a/libs/hwui/ProgramCache.h
+++ b/libs/hwui/ProgramCache.h
@@ -57,7 +57,7 @@
#define PROGRAM_KEY_COLOR_BLEND 0x80
#define PROGRAM_KEY_BITMAP_NPOT 0x100
#define PROGRAM_KEY_SWAP_SRC_DST 0x2000
-#define PROGRAM_KEY_VERTEX_WIDTH 0x4000
+#define PROGRAM_KEY_VERTEX_WIDTH (1 << 37)
#define PROGRAM_KEY_BITMAP_WRAPS_MASK 0x600
#define PROGRAM_KEY_BITMAP_WRAPT_MASK 0x1800
diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp
index 2399216..8885bd5 100644
--- a/media/libmedia/IMediaPlayer.cpp
+++ b/media/libmedia/IMediaPlayer.cpp
@@ -192,8 +192,9 @@
}
status_t invoke(const Parcel& request, Parcel *reply)
- { // Avoid doing any extra copy. The interface descriptor should
- // have been set by MediaPlayer.java.
+ {
+ // Avoid doing any extra copy. The interface descriptor should
+ // have been set by MediaPlayer.java.
return remote()->transact(INVOKE, request, reply);
}
@@ -334,8 +335,8 @@
} break;
case INVOKE: {
CHECK_INTERFACE(IMediaPlayer, data, reply);
- invoke(data, reply);
- return NO_ERROR;
+ status_t result = invoke(data, reply);
+ return result;
} break;
case SET_METADATA_FILTER: {
CHECK_INTERFACE(IMediaPlayer, data, reply);