Loading apex/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,9 @@ apex_defaults { // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. min_sdk_version: "29", // Indicates that pre-installed version of this apex can be compressed. // Whether it actually will be compressed is controlled on per-device basis. compressible: true, } apex { Loading Loading @@ -135,6 +138,9 @@ apex_defaults { // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. min_sdk_version: "29", // Indicates that pre-installed version of this apex can be compressed. // Whether it actually will be compressed is controlled on per-device basis. compressible: true, } prebuilt_etc { Loading camera/aidl/android/hardware/ICameraServiceProxy.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,10 @@ interface ICameraServiceProxy * Update the status of a camera device. */ oneway void notifyCameraState(in CameraSessionStats cameraSessionStats); /** * Reports whether the top activity needs a rotate and crop override. */ boolean isRotateAndCropOverrideNeeded(String packageName, int sensorOrientation, int lensFacing); } camera/camera2/OutputConfiguration.cpp +44 −6 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ bool OutputConfiguration::isMultiResolution() const { return mIsMultiResolution; } const std::vector<int32_t> &OutputConfiguration::getSensorPixelModesUsed() const { return mSensorPixelModesUsed; } OutputConfiguration::OutputConfiguration() : mRotation(INVALID_ROTATION), mSurfaceSetID(INVALID_SET_ID), Loading Loading @@ -156,6 +160,11 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { return err; } std::vector<int32_t> sensorPixelModesUsed; if ((err = parcel->readParcelableVector(&sensorPixelModesUsed)) != OK) { ALOGE("%s: Failed to read sensor pixel mode(s) from parcel", __FUNCTION__); return err; } mRotation = rotation; mSurfaceSetID = setID; mSurfaceType = surfaceType; Loading @@ -171,6 +180,8 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { mGbps.push_back(surface.graphicBufferProducer); } mSensorPixelModesUsed = std::move(sensorPixelModesUsed); ALOGV("%s: OutputConfiguration: rotation = %d, setId = %d, surfaceType = %d," " physicalCameraId = %s, isMultiResolution = %d", __FUNCTION__, mRotation, mSurfaceSetID, mSurfaceType, String8(mPhysicalCameraId).string(), mIsMultiResolution); Loading Loading @@ -240,24 +251,51 @@ status_t OutputConfiguration::writeToParcel(android::Parcel* parcel) const { err = parcel->writeInt32(mIsMultiResolution ? 1 : 0); if (err != OK) return err; err = parcel->writeParcelableVector(mSensorPixelModesUsed); if (err != OK) return err; return OK; } template <typename T> static bool simpleVectorsEqual(T first, T second) { if (first.size() != second.size()) { return false; } for (size_t i = 0; i < first.size(); i++) { if (first[i] != second[i]) { return false; } } return true; } bool OutputConfiguration::gbpsEqual(const OutputConfiguration& other) const { const std::vector<sp<IGraphicBufferProducer> >& otherGbps = other.getGraphicBufferProducers(); return simpleVectorsEqual(otherGbps, mGbps); } if (mGbps.size() != otherGbps.size()) { return false; bool OutputConfiguration::sensorPixelModesUsedEqual(const OutputConfiguration& other) const { const std::vector<int32_t>& othersensorPixelModesUsed = other.getSensorPixelModesUsed(); return simpleVectorsEqual(othersensorPixelModesUsed, mSensorPixelModesUsed); } for (size_t i = 0; i < mGbps.size(); i++) { if (mGbps[i] != otherGbps[i]) { return false; bool OutputConfiguration::sensorPixelModesUsedLessThan(const OutputConfiguration& other) const { const std::vector<int32_t>& spms = other.getSensorPixelModesUsed(); if (mSensorPixelModesUsed.size() != spms.size()) { return mSensorPixelModesUsed.size() < spms.size(); } for (size_t i = 0; i < spms.size(); i++) { if (mSensorPixelModesUsed[i] != spms[i]) { return mSensorPixelModesUsed[i] < spms[i]; } } return true; return false; } bool OutputConfiguration::gbpsLessThan(const OutputConfiguration& other) const { Loading camera/include/camera/camera2/OutputConfiguration.h +11 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ public: String16 getPhysicalCameraId() const; bool isMultiResolution() const; // set of sensor pixel mode resolutions allowed {MAX_RESOLUTION, DEFAULT_MODE}; const std::vector<int32_t>& getSensorPixelModesUsed() const; /** * Keep impl up-to-date with OutputConfiguration.java in frameworks/base */ Loading Loading @@ -86,7 +88,8 @@ public: mIsShared == other.mIsShared && gbpsEqual(other) && mPhysicalCameraId == other.mPhysicalCameraId && mIsMultiResolution == other.mIsMultiResolution); mIsMultiResolution == other.mIsMultiResolution && sensorPixelModesUsedEqual(other)); } bool operator != (const OutputConfiguration& other) const { return !(*this == other); Loading Loading @@ -120,13 +123,19 @@ public: if (mIsMultiResolution != other.mIsMultiResolution) { return mIsMultiResolution < other.mIsMultiResolution; } if (!sensorPixelModesUsedEqual(other)) { return sensorPixelModesUsedLessThan(other); } return gbpsLessThan(other); } bool operator > (const OutputConfiguration& other) const { return (*this != other && !(*this < other)); } bool gbpsEqual(const OutputConfiguration& other) const; bool sensorPixelModesUsedEqual(const OutputConfiguration& other) const; bool sensorPixelModesUsedLessThan(const OutputConfiguration& other) const; bool gbpsLessThan(const OutputConfiguration& other) const; void addGraphicProducer(sp<IGraphicBufferProducer> gbp) {mGbps.push_back(gbp);} private: Loading @@ -140,6 +149,7 @@ private: bool mIsShared; String16 mPhysicalCameraId; bool mIsMultiResolution; std::vector<int32_t> mSensorPixelModesUsed; }; } // namespace params } // namespace camera2 Loading camera/ndk/impl/ACameraMetadata.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -534,6 +534,7 @@ ACameraMetadata::isCaptureRequestTag(const uint32_t tag) { case ACAMERA_SENSOR_SENSITIVITY: case ACAMERA_SENSOR_TEST_PATTERN_DATA: case ACAMERA_SENSOR_TEST_PATTERN_MODE: case ACAMERA_SENSOR_PIXEL_MODE: case ACAMERA_SHADING_MODE: case ACAMERA_STATISTICS_FACE_DETECT_MODE: case ACAMERA_STATISTICS_HOT_PIXEL_MAP_MODE: Loading Loading @@ -584,6 +585,7 @@ std::unordered_set<uint32_t> ACameraMetadata::sSystemTags ({ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP, ANDROID_SENSOR_PROFILE_TONE_CURVE, ANDROID_SENSOR_OPAQUE_RAW_SIZE, ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION, ANDROID_SHADING_STRENGTH, ANDROID_STATISTICS_HISTOGRAM_MODE, ANDROID_STATISTICS_SHARPNESS_MAP_MODE, Loading Loading
apex/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,9 @@ apex_defaults { // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. min_sdk_version: "29", // Indicates that pre-installed version of this apex can be compressed. // Whether it actually will be compressed is controlled on per-device basis. compressible: true, } apex { Loading Loading @@ -135,6 +138,9 @@ apex_defaults { // - build artifacts (lib/javalib/bin) against Android 10 SDK // so that the artifacts can run. min_sdk_version: "29", // Indicates that pre-installed version of this apex can be compressed. // Whether it actually will be compressed is controlled on per-device basis. compressible: true, } prebuilt_etc { Loading
camera/aidl/android/hardware/ICameraServiceProxy.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,10 @@ interface ICameraServiceProxy * Update the status of a camera device. */ oneway void notifyCameraState(in CameraSessionStats cameraSessionStats); /** * Reports whether the top activity needs a rotate and crop override. */ boolean isRotateAndCropOverrideNeeded(String packageName, int sensorOrientation, int lensFacing); }
camera/camera2/OutputConfiguration.cpp +44 −6 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ bool OutputConfiguration::isMultiResolution() const { return mIsMultiResolution; } const std::vector<int32_t> &OutputConfiguration::getSensorPixelModesUsed() const { return mSensorPixelModesUsed; } OutputConfiguration::OutputConfiguration() : mRotation(INVALID_ROTATION), mSurfaceSetID(INVALID_SET_ID), Loading Loading @@ -156,6 +160,11 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { return err; } std::vector<int32_t> sensorPixelModesUsed; if ((err = parcel->readParcelableVector(&sensorPixelModesUsed)) != OK) { ALOGE("%s: Failed to read sensor pixel mode(s) from parcel", __FUNCTION__); return err; } mRotation = rotation; mSurfaceSetID = setID; mSurfaceType = surfaceType; Loading @@ -171,6 +180,8 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { mGbps.push_back(surface.graphicBufferProducer); } mSensorPixelModesUsed = std::move(sensorPixelModesUsed); ALOGV("%s: OutputConfiguration: rotation = %d, setId = %d, surfaceType = %d," " physicalCameraId = %s, isMultiResolution = %d", __FUNCTION__, mRotation, mSurfaceSetID, mSurfaceType, String8(mPhysicalCameraId).string(), mIsMultiResolution); Loading Loading @@ -240,24 +251,51 @@ status_t OutputConfiguration::writeToParcel(android::Parcel* parcel) const { err = parcel->writeInt32(mIsMultiResolution ? 1 : 0); if (err != OK) return err; err = parcel->writeParcelableVector(mSensorPixelModesUsed); if (err != OK) return err; return OK; } template <typename T> static bool simpleVectorsEqual(T first, T second) { if (first.size() != second.size()) { return false; } for (size_t i = 0; i < first.size(); i++) { if (first[i] != second[i]) { return false; } } return true; } bool OutputConfiguration::gbpsEqual(const OutputConfiguration& other) const { const std::vector<sp<IGraphicBufferProducer> >& otherGbps = other.getGraphicBufferProducers(); return simpleVectorsEqual(otherGbps, mGbps); } if (mGbps.size() != otherGbps.size()) { return false; bool OutputConfiguration::sensorPixelModesUsedEqual(const OutputConfiguration& other) const { const std::vector<int32_t>& othersensorPixelModesUsed = other.getSensorPixelModesUsed(); return simpleVectorsEqual(othersensorPixelModesUsed, mSensorPixelModesUsed); } for (size_t i = 0; i < mGbps.size(); i++) { if (mGbps[i] != otherGbps[i]) { return false; bool OutputConfiguration::sensorPixelModesUsedLessThan(const OutputConfiguration& other) const { const std::vector<int32_t>& spms = other.getSensorPixelModesUsed(); if (mSensorPixelModesUsed.size() != spms.size()) { return mSensorPixelModesUsed.size() < spms.size(); } for (size_t i = 0; i < spms.size(); i++) { if (mSensorPixelModesUsed[i] != spms[i]) { return mSensorPixelModesUsed[i] < spms[i]; } } return true; return false; } bool OutputConfiguration::gbpsLessThan(const OutputConfiguration& other) const { Loading
camera/include/camera/camera2/OutputConfiguration.h +11 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ public: String16 getPhysicalCameraId() const; bool isMultiResolution() const; // set of sensor pixel mode resolutions allowed {MAX_RESOLUTION, DEFAULT_MODE}; const std::vector<int32_t>& getSensorPixelModesUsed() const; /** * Keep impl up-to-date with OutputConfiguration.java in frameworks/base */ Loading Loading @@ -86,7 +88,8 @@ public: mIsShared == other.mIsShared && gbpsEqual(other) && mPhysicalCameraId == other.mPhysicalCameraId && mIsMultiResolution == other.mIsMultiResolution); mIsMultiResolution == other.mIsMultiResolution && sensorPixelModesUsedEqual(other)); } bool operator != (const OutputConfiguration& other) const { return !(*this == other); Loading Loading @@ -120,13 +123,19 @@ public: if (mIsMultiResolution != other.mIsMultiResolution) { return mIsMultiResolution < other.mIsMultiResolution; } if (!sensorPixelModesUsedEqual(other)) { return sensorPixelModesUsedLessThan(other); } return gbpsLessThan(other); } bool operator > (const OutputConfiguration& other) const { return (*this != other && !(*this < other)); } bool gbpsEqual(const OutputConfiguration& other) const; bool sensorPixelModesUsedEqual(const OutputConfiguration& other) const; bool sensorPixelModesUsedLessThan(const OutputConfiguration& other) const; bool gbpsLessThan(const OutputConfiguration& other) const; void addGraphicProducer(sp<IGraphicBufferProducer> gbp) {mGbps.push_back(gbp);} private: Loading @@ -140,6 +149,7 @@ private: bool mIsShared; String16 mPhysicalCameraId; bool mIsMultiResolution; std::vector<int32_t> mSensorPixelModesUsed; }; } // namespace params } // namespace camera2 Loading
camera/ndk/impl/ACameraMetadata.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -534,6 +534,7 @@ ACameraMetadata::isCaptureRequestTag(const uint32_t tag) { case ACAMERA_SENSOR_SENSITIVITY: case ACAMERA_SENSOR_TEST_PATTERN_DATA: case ACAMERA_SENSOR_TEST_PATTERN_MODE: case ACAMERA_SENSOR_PIXEL_MODE: case ACAMERA_SHADING_MODE: case ACAMERA_STATISTICS_FACE_DETECT_MODE: case ACAMERA_STATISTICS_HOT_PIXEL_MAP_MODE: Loading Loading @@ -584,6 +585,7 @@ std::unordered_set<uint32_t> ACameraMetadata::sSystemTags ({ ANDROID_SENSOR_PROFILE_HUE_SAT_MAP, ANDROID_SENSOR_PROFILE_TONE_CURVE, ANDROID_SENSOR_OPAQUE_RAW_SIZE, ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION, ANDROID_SHADING_STRENGTH, ANDROID_STATISTICS_HISTOGRAM_MODE, ANDROID_STATISTICS_SHARPNESS_MAP_MODE, Loading