Merge "Prevent crash when ColorStateList has unresolved attrs" into mnc-dev
diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java
index b3e7cfc..c22ee5f 100644
--- a/core/java/android/hardware/camera2/CameraCaptureSession.java
+++ b/core/java/android/hardware/camera2/CameraCaptureSession.java
@@ -654,16 +654,22 @@
 
         /**
          * This method is called when the camera device has started capturing
-         * the output image for the request, at the beginning of image exposure.
+         * the output image for the request, at the beginning of image exposure, or
+         * when the camera device has started processing an input image for a reprocess
+         * request.
          *
-         * <p>This callback is invoked right as the capture of a frame begins,
-         * so it is the most appropriate time for playing a shutter sound,
-         * or triggering UI indicators of capture.</p>
+         * <p>For a regular capture request, this callback is invoked right as
+         * the capture of a frame begins, so it is the most appropriate time
+         * for playing a shutter sound, or triggering UI indicators of capture.</p>
          *
          * <p>The request that is being used for this capture is provided, along
-         * with the actual timestamp for the start of exposure. This timestamp
-         * matches the timestamp that will be included in
-         * {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field},
+         * with the actual timestamp for the start of exposure. For a reprocess
+         * request, this timestamp will be the input image's start of exposure
+         * which matches {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field}
+         * of the {@link TotalCaptureResult} that was used to
+         * {@link CameraDevice#createReprocessCaptureRequest create the reprocess request}.
+         * This timestamp matches the timestamps that will be
+         * included in {@link CaptureResult#SENSOR_TIMESTAMP the result timestamp field},
          * and in the buffers sent to each output Surface. These buffer
          * timestamps are accessible through, for example,
          * {@link android.media.Image#getTimestamp() Image.getTimestamp()} or
@@ -679,7 +685,9 @@
          *
          * @param session the session returned by {@link CameraDevice#createCaptureSession}
          * @param request the request for the capture that just begun
-         * @param timestamp the timestamp at start of capture, in nanoseconds.
+         * @param timestamp the timestamp at start of capture for a regular request, or
+         *                  the timestamp at the input image's start of capture for a
+         *                  reprocess request, in nanoseconds.
          * @param frameNumber the frame number for this capture
          *
          * @see android.media.MediaActionSound
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index f4017d0..96faad2 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -2988,6 +2988,10 @@
      * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
      * be compared to other timestamps from other subsystems that
      * are using that base.</p>
+     * <p>For reprocessing, the timestamp will match the start of exposure of
+     * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
+     * timestamp} in the TotalCaptureResult that was used to create the
+     * reprocess capture request.</p>
      * <p><b>Units</b>: Nanoseconds</p>
      * <p><b>Range of valid values:</b><br>
      * &gt; 0</p>
diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
index 2de846c..943e421 100644
--- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
+++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
@@ -752,12 +752,14 @@
                     CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES          ,
                     CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE                   ,
                     CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP                    ,
+                    CameraCharacteristics.CONTROL_AE_LOCK_AVAILABLE                       ,
                     CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES                      ,
                     CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS                       ,
                     CameraCharacteristics.CONTROL_AVAILABLE_MODES                         ,
                     CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES                   ,
                     CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES     ,
                     CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES                     ,
+                    CameraCharacteristics.CONTROL_AWB_LOCK_AVAILABLE                      ,
                     CameraCharacteristics.CONTROL_MAX_REGIONS                             ,
                     CameraCharacteristics.FLASH_INFO_AVAILABLE                            ,
                     CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL                   ,
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index dfd523a..50eed3e 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -685,8 +685,6 @@
         final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
         final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
         final String currentBootloader = SystemProperties.get("ro.bootloader");
-        final String requiredRecovery = SystemProperties.get("ro.expect.recovery_id");
-        final String currentRecovery = SystemProperties.get("ro.recovery_id");
         final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
         final String currentRadio = SystemProperties.get("gsm.version.baseband");
 
@@ -703,6 +701,7 @@
             }
         }
 
+        /* TODO: Figure out issue with checks failing
         if (!TextUtils.isEmpty(bootimage)) {
             if (!Objects.equals(system, bootimage)) {
                 Slog.e(TAG, "Mismatched fingerprints; system reported " + system
@@ -719,15 +718,6 @@
             }
         }
 
-        if (!TextUtils.isEmpty(requiredRecovery)) {
-            if (!Objects.equals(currentRecovery, requiredRecovery)) {
-                Slog.e(TAG, "Mismatched recovery version: build requires " + requiredRecovery
-                        + " but runtime reports " + currentRecovery);
-                return false;
-            }
-        }
-
-        /* TODO: uncomment when new bootloader lands b/20860620
         if (!TextUtils.isEmpty(requiredRadio)) {
             if (!Objects.equals(currentRadio, requiredRadio)) {
                 Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
diff --git a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
index f159c30..701bd67 100644
--- a/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore/AndroidKeyStoreSpi.java
@@ -621,9 +621,6 @@
                 (params.getKeyValidityForConsumptionEnd() != null)
                         ? params.getKeyValidityForConsumptionEnd() : new Date(Long.MAX_VALUE));
 
-        // TODO: Remove this once keymaster does not require us to specify the size of imported key.
-        args.addInt(KeymasterDefs.KM_TAG_KEY_SIZE, keyMaterial.length * 8);
-
         if (((purposes & KeyProperties.PURPOSE_ENCRYPT) != 0)
                 && (!params.isRandomizedEncryptionRequired())) {
             // Permit caller-provided IV when encrypting with this key