Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09920f58 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 9730513 from 2cbefff9 to udc-release

Change-Id: I28e7d977167363cad5b40fbc4f8f519a3de66043
parents 6adb1ebe 2cbefff9
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -166,12 +166,6 @@ prebuilt_etc {
    defaults: ["frameworks_native_data_etc_defaults"],
}

prebuilt_etc {
    name: "android.hardware.telephony.satellite.prebuilt.xml",
    src: "android.hardware.telephony.satellite.xml",
    defaults: ["frameworks_native_data_etc_defaults"],
}

prebuilt_etc {
    name: "android.hardware.usb.accessory.prebuilt.xml",
    src: "android.hardware.usb.accessory.xml",
+0 −20
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!-- Feature for devices that support Satellite communication via Satellite HAL APIs. -->
<permissions>
    <feature name="android.hardware.telephony.satellite" />
</permissions>
+3 −1
Original line number Diff line number Diff line
@@ -206,12 +206,14 @@ public:
     * @param output_format flag for setting output color format. if set to
     *                      {@code JPEGR_OUTPUT_SDR}, decoder will only decode the primary image
     *                      which is SDR. Default value is JPEGR_OUTPUT_HDR_LINEAR.
     * @param recovery_map destination of the decoded recovery map.
     * @return NO_ERROR if decoding succeeds, error code if error occurs.
     */
    status_t decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
                         jr_uncompressed_ptr dest,
                         jr_exif_ptr exif = nullptr,
                         jpegr_output_format output_format = JPEGR_OUTPUT_HDR_LINEAR);
                         jpegr_output_format output_format = JPEGR_OUTPUT_HDR_LINEAR,
                         jr_uncompressed_ptr recovery_map = nullptr);

    /*
    * Gets Info from JPEGR file without decoding it.
+38 −8
Original line number Diff line number Diff line
@@ -331,7 +331,8 @@ status_t JpegR::getJPEGRInfo(jr_compressed_ptr compressed_jpegr_image, jr_info_p
status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
                            jr_uncompressed_ptr dest,
                            jr_exif_ptr exif,
                            jpegr_output_format output_format) {
                            jpegr_output_format output_format,
                            jr_uncompressed_ptr recovery_map) {
  if (compressed_jpegr_image == nullptr || dest == nullptr) {
    return ERROR_JPEGR_INVALID_NULL_PTR;
  }
@@ -350,13 +351,46 @@ status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
           uncompressed_rgba_image.width * uncompressed_rgba_image.height * 4);
    dest->width = uncompressed_rgba_image.width;
    dest->height = uncompressed_rgba_image.height;

    if (recovery_map == nullptr && exif == nullptr) {
      return NO_ERROR;
    }

    if (exif != nullptr) {
      if (exif->data == nullptr) {
        return ERROR_JPEGR_INVALID_NULL_PTR;
      }
      if (exif->length < jpeg_decoder.getEXIFSize()) {
        return ERROR_JPEGR_BUFFER_TOO_SMALL;
      }
      memcpy(exif->data, jpeg_decoder.getEXIFPtr(), jpeg_decoder.getEXIFSize());
      exif->length = jpeg_decoder.getEXIFSize();
    }
    if (recovery_map == nullptr) {
      return NO_ERROR;
    }
  }

  jpegr_compressed_struct compressed_map;
  jpegr_metadata metadata;
  JPEGR_CHECK(extractRecoveryMap(compressed_jpegr_image, &compressed_map));

  JpegDecoderHelper recovery_map_decoder;
  if (!recovery_map_decoder.decompressImage(compressed_map.data, compressed_map.length)) {
    return ERROR_JPEGR_DECODE_ERROR;
  }

  if (recovery_map != nullptr) {
    recovery_map->width = recovery_map_decoder.getDecompressedImageWidth();
    recovery_map->height = recovery_map_decoder.getDecompressedImageHeight();
    int size = recovery_map->width * recovery_map->height;
    recovery_map->data = malloc(size);
    memcpy(recovery_map->data, recovery_map_decoder.getDecompressedImagePtr(), size);
  }

  if (output_format == JPEGR_OUTPUT_SDR) {
    return NO_ERROR;
  }

  JpegDecoderHelper jpeg_decoder;
  if (!jpeg_decoder.decompressImage(compressed_jpegr_image->data, compressed_jpegr_image->length)) {
    return ERROR_JPEGR_DECODE_ERROR;
@@ -373,11 +407,6 @@ status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
    exif->length = jpeg_decoder.getEXIFSize();
  }

  JpegDecoderHelper recovery_map_decoder;
  if (!recovery_map_decoder.decompressImage(compressed_map.data, compressed_map.length)) {
    return ERROR_JPEGR_DECODE_ERROR;
  }

  jpegr_uncompressed_struct map;
  map.data = recovery_map_decoder.getDecompressedImagePtr();
  map.width = recovery_map_decoder.getDecompressedImageWidth();
@@ -388,6 +417,7 @@ status_t JpegR::decodeJPEGR(jr_compressed_ptr compressed_jpegr_image,
  uncompressed_yuv_420_image.width = jpeg_decoder.getDecompressedImageWidth();
  uncompressed_yuv_420_image.height = jpeg_decoder.getDecompressedImageHeight();

  jpegr_metadata metadata;
  if (!getMetadataFromXMP(static_cast<uint8_t*>(recovery_map_decoder.getXMPPtr()),
                          recovery_map_decoder.getXMPSize(), &metadata)) {
    return ERROR_JPEGR_DECODE_ERROR;
+9 −3
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ float RefreshRateSelector::calculateNonExactMatchingLayerScoreLocked(const Layer
        // significantly faster than the display rate, at it would cause a significant frame drop.
        // It is more appropriate to choose a higher display rate even if
        // a pull-down will be required.
        constexpr float kMinMultiplier = 0.25f;
        constexpr float kMinMultiplier = 0.75f;
        if (multiplier >= kMinMultiplier &&
            isFractionalPairOrMultiple(refreshRate, layer.desiredRefreshRate)) {
            return kScoreForFractionalPairs;
@@ -958,7 +958,7 @@ auto RefreshRateSelector::rankFrameRates(std::optional<int> anchorGroupOpt,
        }

        const bool ascending = (refreshRateOrder == RefreshRateOrder::Ascending);
        const auto id = frameRateMode.modePtr->getId();
        const auto id = modePtr->getId();
        if (ascending && frameRateMode.fps < *maxRenderRateForMode.get(id)) {
            // TODO(b/266481656): Once this bug is fixed, we can remove this workaround and actually
            //  use a lower frame rate when we want Ascending frame rates.
@@ -970,14 +970,20 @@ auto RefreshRateSelector::rankFrameRates(std::optional<int> anchorGroupOpt,
        if (ascending) {
            score = 1.0f / score;
        }

        constexpr float kScore = std::numeric_limits<float>::max();
        if (preferredDisplayModeOpt) {
            if (*preferredDisplayModeOpt == modePtr->getId()) {
                constexpr float kScore = std::numeric_limits<float>::max();
                ranking.emplace_front(ScoredFrameRate{frameRateMode, kScore});
                return;
            }
            constexpr float kNonPreferredModePenalty = 0.95f;
            score *= kNonPreferredModePenalty;
        } else if (ascending && id == getMinRefreshRateByPolicyLocked()->getId()) {
            // TODO(b/266481656): Once this bug is fixed, we can remove this workaround
            //  and actually use a lower frame rate when we want Ascending frame rates.
            ranking.emplace_front(ScoredFrameRate{frameRateMode, kScore});
            return;
        }

        ALOGV("%s(%s) %s (%s) scored %.2f", whence, ftl::enum_string(refreshRateOrder).c_str(),
Loading