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

Commit 263ac3da authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5588664 from bb65cc59 to qt-c2f2-release

Change-Id: I0d867ee6c3913ce682a2bf545bfce6f090de9934
parents 7f34b78b bb65cc59
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -14,8 +14,14 @@
 * limitations under the License.
 */

/**
 * @addtogroup AHardwareBuffer
 * @{
 */

/**
 * @file hardware_buffer_jni.h
 * @brief JNI glue for native hardware buffers.
 */

#ifndef ANDROID_HARDWARE_BUFFER_JNI_H
@@ -30,23 +36,25 @@
__BEGIN_DECLS

/**
 * Return the AHardwareBuffer associated with a Java HardwareBuffer object,
 * for interacting with it through native code. This method does not acquire any
 * additional reference to the AHardwareBuffer that is returned. To keep the
 * AHardwareBuffer live after the Java HardwareBuffer object got garbage
 * collected, be sure to use AHardwareBuffer_acquire() to acquire an additional
 * reference.
 * Return the AHardwareBuffer wrapped by a Java HardwareBuffer object.
 *
 * This method does not acquire any additional reference to the AHardwareBuffer
 * that is returned. To keep the AHardwareBuffer live after the Java
 * HardwareBuffer object got garbage collected, be sure to use AHardwareBuffer_acquire()
 * to acquire an additional reference.
 */
AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer(JNIEnv* env,
        jobject hardwareBufferObj);
        jobject hardwareBufferObj) __INTRODUCED_IN(26);

/**
 * Return a new Java HardwareBuffer object that wraps the passed native
 * AHardwareBuffer object.
 */
jobject AHardwareBuffer_toHardwareBuffer(JNIEnv* env,
        AHardwareBuffer* hardwareBuffer);
        AHardwareBuffer* hardwareBuffer) __INTRODUCED_IN(26);

__END_DECLS

#endif // ANDROID_HARDWARE_BUFFER_JNI_H

/** @} */
+5 −3
Original line number Diff line number Diff line
@@ -110,13 +110,15 @@ std::set<int> get_interesting_hal_pids() {
}

bool IsZygote(int pid) {
    static const std::string kZygotePrefix = "zygote";

    std::string cmdline;
    if (!android::base::ReadFileToString(android::base::StringPrintf("/proc/%d/cmdline", pid),
                                         &cmdline)) {
        return true;
    }

    return (cmdline.find(kZygotePrefix) == 0);
    // cmdline has embedded nulls; only consider argv[0].
    cmdline = std::string(cmdline.c_str());

    return cmdline == "zygote" || cmdline == "zygote64" || cmdline == "usap32" ||
            cmdline == "usap64";
}
+21 −2
Original line number Diff line number Diff line
@@ -1049,6 +1049,7 @@ status_t SurfaceFlinger::getDisplayColorModes(const sp<IBinder>& displayToken,
    }

    std::vector<ColorMode> modes;
    bool isInternalDisplay = false;
    {
        ConditionalLock lock(mStateLock, std::this_thread::get_id() != mMainThreadId);

@@ -1058,9 +1059,20 @@ status_t SurfaceFlinger::getDisplayColorModes(const sp<IBinder>& displayToken,
        }

        modes = getHwComposer().getColorModes(*displayId);
        isInternalDisplay = displayId == getInternalDisplayIdLocked();
    }
    outColorModes->clear();

    // If it's built-in display and the configuration claims it's not wide color capable,
    // filter out all wide color modes. The typical reason why this happens is that the
    // hardware is not good enough to support GPU composition of wide color, and thus the
    // OEMs choose to disable this capability.
    if (isInternalDisplay && !hasWideColorDisplay) {
        std::remove_copy_if(modes.cbegin(), modes.cend(), std::back_inserter(*outColorModes),
                            isWideColorMode);
    } else {
        std::copy(modes.cbegin(), modes.cend(), std::back_inserter(*outColorModes));
    }

    return NO_ERROR;
}
@@ -1207,6 +1219,13 @@ status_t SurfaceFlinger::isWideColorDisplay(const sp<IBinder>& displayToken,
    if (!display) {
        return BAD_VALUE;
    }

    // Use hasWideColorDisplay to override built-in display.
    const auto displayId = display->getId();
    if (displayId && displayId == getInternalDisplayIdLocked()) {
        *outIsWideColorDisplay = hasWideColorDisplay;
        return NO_ERROR;
    }
    *outIsWideColorDisplay = display->hasWideColorGamut();
    return NO_ERROR;
}
@@ -4746,7 +4765,7 @@ void SurfaceFlinger::dumpDisplayIdentificationData(std::string& result) const {
}

void SurfaceFlinger::dumpWideColorInfo(std::string& result) const {
    StringAppendF(&result, "Device has wide color display: %d\n", hasWideColorDisplay);
    StringAppendF(&result, "Device has wide color built-in display: %d\n", hasWideColorDisplay);
    StringAppendF(&result, "Device uses color management: %d\n", useColorManagement);
    StringAppendF(&result, "DisplayColorSetting: %s\n",
                  decodeDisplayColorSetting(mDisplayColorSetting).c_str());